openapi: 3.0.0
info:
  title: BioStar X API
  description: >-
    ## Overview


    Suprema BioStar X API is a JSON-based API. All requests are made to
    endpoints beginning with
    [https://server_ip|domain_name[:port]/api](https://server_ip|domain_name:port/api)


    The API can be used to perform almost any operation. Following are a few
    examples of what can be done with Suprema BioStar X API:


    - Manage User data
        
    - Manage Access Group data
        
    - Manage Doors data
        
    - Assign an Access Group to one or multiple User
        
    - Assign a User with one or multiple Access Group
        
    - Manage Devices
        
    - And many more...
        

    All requests must be secure (https).


    ## General Information


    To call the API, BioStar X is mainly using HTTP Methods `GET`, `POST`,
    `PUT`, and `DELETE`.


    - `GET` is used to retrieve data from the server at the specified resource.
    For example, if you want to retrieve the User data with /users endpoint,
    then by making a `GET` request to the endpoint should result with the list
    of all available users.
        
    - `POST` request is used to send data to the server to create or  a
    resource. The data sent to the server is stored on the body of the HTTP
    request.
        
    - `PUT` is similar to `POST` in that it creates or s a resource. The
    difference between them is that when calling the same `PUT` requests
    multiple times it will have the same result. While calling a `POST` request
    repeatedly will create the same resource multiple times.
        
    - `DELETE` is used to delete resources at the specified endpoint.
        

    There are four parameter location that’s being used on Suprema BioStar X
    API:


    - PATH parameter is located on the URL, usually on the end of an endpoint.
    For example in /items/{ItemID}, the PATH parameter is ItemID.
        
    - BODY. An array of string values will be located on the BODY of the HTTP
    request. The request body needs to be in JSON format.
        
    - QUERY. Similar to the PATH parameter, QUERY parameter is also located on
    the URL, the difference is QUERY parameter will be located after a question
    mark. Example: /items?id=###, the QUERY parameter is id.
        
    - HEADER. Custom headers that are expected as part of the request.
        

    Path templating refers to the usage of template expressions, delimited by
    curly braces ({}), to mark a section of a URL path as replaceable using path
    parameters. Example:
    [https://127.0.0.1:4433/api/some_api/{id](https://127.0.0.1:4433/api/some_api/%7Bid)}  

    Above example shows that the required value will be placed on {id}



    ## Import the Postman collection

    To import the Postman collection online, follow these steps:

    1. Click the **Download** button at the top of this page to download the
    OpenAPI specification file(`bsxapi.yaml`).

    2. Go to <a href="https://web.postman.co/home" target="_blank" rel="noopener
    noreferrer">Postman</a> and sign in.

    3. Select your workspace from the workspace selector in the top left. Or
    create a workspace if you don't have one.

    4. Click **Import** in the sidebar.

    5. Select downloaded file, or drag the file into the import window.

       <img src="https://assets.postman.com/postman-docs/v10/import-export-import-ui-v10-20.jpg" width="600px" />

    6. Click **Import** to complete the process.



    ## Release Notes

    **2025-09-30**

    - Initial version
  version: 1.0.0
  contact:
    name: Suprema Inc.
    url: https://www.supremainc.com
    email: CS@suprema.co.kr
servers:
  - url: https://{baseurl}
    description: BioStar X IP or Domain
    variables:
      baseurl:
        default: 127.0.0.1:443
        description: BioStar X server hostname and port
security:
  - SessionAuth: []
tags:
  - name: Authorization
  - name: Access Group
    description: This section contains all API related to Access Group (AG)
  - name: Access Level
    description: This section contains all API related to Access Level (AL)
  - name: Backup
  - name: Cards
  - name: User Groups
  - name: User
    description: This section contains all API related to Users
  - name: Device Group
  - name: Device
  - name: Door Groups
  - name: Doors
  - name: Elevator Groups
  - name: Elevators
  - name: Firmware
  - name: Floor Levels
  - name: Schedules
  - name: Holiday Groups
  - name: Trigger Actions
  - name: Quick Action
  - name: Setting
  - name: Active Directory
    description: Active Directory integration and configuration
  - name: Email Setting
    description: Email notification settings
  - name: Preference
    description: System preferences and configuration
  - name: Mobile Access
  - name: Events
  - name: Audit
  - name: Zones
  - name: Occupancy Limit
  - name: Step by Step
  - name: Event Log
  - name: Create User
  - name: Virtual Device & Event Import
    description: >-
      This feature allows external systems (e.g., mobile T&A apps) to send
      **punch/access events** directly to **BioStar X** **without database-level
      integration**.


      To ensure data consistency, each event must be associated with a **Virtual
      Device** — a device record created inside BioStar X to represent the
      external source.


      **Notes:**


      - Virtual Devices are **non-functional placeholders** and **cannot be used
      for access control, doors, or Advanced AC features**. Their only purpose
      is to logically link imported events to a known device identity.
          
      - **BioStar X Event Log API** license is required for the feature.
          

      ### Step-by-Step: How to Use


      #### Step 1: Create a Virtual Device


      - Use `POST /api/v2/virtual_devices` to create a new virtual device.
          
      - Usable ID range: **100001–999999**
          
      - Ensure it’s **not a duplicate ID or name**.
          
      - Assign it to an existing **device group**.
          

      ---


      #### Step 2: Verify Virtual Device


      - Use `GET /api/v2/virtual_devices`
          

      to confirm your virtual device is registered and visible.


      ---


      #### Step 3: Import Events


      - Prepare your event payload with the same `packet_device_id` as the
      virtual device ID.
          
      - Ensure all timestamps are in **UTC**.
          
      - Use `POST /api/events/import` to upload multiple events at once.
          

      ---


      #### Step 4: Verify Event Import


      - After import, use existing endpoints such as:
          
          - `POST /api/events/search`
              

      to confirm the events are visible in BioStar X event logs.


      ---


      #### Step 5: Troubleshooting


      If an error occurs:


      - Check that `is_virtual_device` is `"true"`.
          
      - Confirm all `user_id`s exist.
          
      - Verify datetime formatting (`YYYY-MM-DDTHH:mm:ssZ`).
          
      - Ensure the event code is either `4088` or `6400`.
x-tagGroups:
  - name: Authorization
    tags:
      - Authorization
  - name: Access Group
    tags:
      - Access Group
  - name: Access Level
    tags:
      - Access Level
  - name: Backup
    tags:
      - Backup
  - name: Cards
    tags:
      - Cards
  - name: User Groups
    tags:
      - User Groups
  - name: User
    tags:
      - User
  - name: Device Group
    tags:
      - Device Group
  - name: Device
    tags:
      - Device
  - name: Door Groups
    tags:
      - Door Groups
  - name: Doors
    tags:
      - Doors
  - name: Elevator Groups
    tags:
      - Elevator Groups
  - name: Elevators
    tags:
      - Elevators
  - name: Firmware
    tags:
      - Firmware
  - name: Floor Levels
    tags:
      - Floor Levels
  - name: Schedules
    tags:
      - Schedules
  - name: Holiday Groups
    tags:
      - Holiday Groups
  - name: Trigger Actions
    tags:
      - Trigger Actions
  - name: Quick Action
    tags:
      - Quick Action
  - name: Settings
    tags:
      - Setting
      - Active Directory
      - Email Setting
      - Preference
      - Virtual Device & Event Import
  - name: Mobile Access
    tags:
      - Mobile Access
  - name: Events
    tags:
      - Events
  - name: Audit
    tags:
      - Audit
  - name: Zones
    tags:
      - Zones
      - Occupancy Limit
  - name: Step by Step
    tags:
      - Event Log
      - Create User
paths:
  /api/login:
    post:
      tags:
        - Authorization
      summary: Login
      operationId: login
      description: >-
        In order to create User through Suprema BioStar X API, you will need a
        Session ID which will be available after you’re logged in.


        To log in, make a form encoded server side POST request as shown on
        example right.

        There will be a key called bs-session-id, which is a consecutive strings
        of hex digits located on the header of the response:  


        `bs-session-id: 643f64efb7114485a2fd89de17ca13fb`


        This value will be used as authorization of the APIs that will be
        called. To apply this value, put it on the header of the API that will
        be called with key name `bs-session-id`.
      security: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                User:
                  type: object
                  properties:
                    login_id:
                      type: string
                      description: Your login ID.
                    password:
                      type: string
                      description: Your password.
              required:
                - login_id
                - password
            example:
              User:
                login_id: admin
                password: admin
      responses:
        '200':
          description: Successful response
          headers:
            bs-session-id:
              schema:
                type: string
              description: Session ID for authenticating subsequent API requests
              example: c52127fea7f645149083d04d89ad68e5
            Content-Type:
              schema:
                type: string
              example: application/json;charset=UTF-8
          content:
            application/json:
              schema:
                type: object
                properties:
                  User:
                    type: object
                  Response:
                    type: object
              example:
                User:
                  user_id: '1'
                  name: Administrator
                  gender: '1'
                  email: admin111@gmail.com
                  birthday: '1977-10-08T04:00:00.00Z'
                  photo_exists: 'false'
                  pin_exists: 'false'
                  login_id: admin
                  password_exists: 'true'
                  d_count: '15'
                  last_modified: '946'
                  idx_last_modified: '263'
                  start_datetime: '2001-01-01T00:00:00.00Z'
                  expiry_datetime: '2030-12-31T23:59:00.00Z'
                  security_level: '0'
                  display_duration: '20'
                  display_count: '3'
                  permission:
                    id: '1'
                    name: Administrator
                    description: this is a permission for Administrator
                    filter:
                      UserGroup:
                        - '1'
                      DeviceGroup:
                        - '1'
                      DoorGroup:
                        - '1'
                      ElevatorGroup:
                        - '1'
                      ZoneType:
                        - '-1'
                      AccessGroup:
                        - '0'
                      GraphicMapGroup:
                        - '1'
                    module:
                      Dashboard:
                        read: 'true'
                        write: 'true'
                      User:
                        read: 'true'
                        write: 'true'
                      Device:
                        read: 'true'
                        write: 'true'
                      Door:
                        read: 'true'
                        write: 'true'
                      Elevator:
                        read: 'true'
                        write: 'true'
                      Zone:
                        read: 'true'
                        write: 'true'
                      AccessControl:
                        read: 'true'
                        write: 'true'
                      Monitoring:
                        read: 'true'
                        write: 'true'
                      TA:
                        read: 'true'
                        write: 'true'
                      Setting:
                        read: 'true'
                        write: 'true'
                      Video:
                        read: 'true'
                        write: 'true'
                      Visitor:
                        read: 'true'
                        write: 'true'
                    device:
                      - id: '542071155'
                      - id: '543720368'
                      - id: '939257394'
                    user:
                      - id: '1'
                      - id: '2'
                      - id: '3'
                      - id: '4'
                      - id: '5'
                      - id: '6'
                      - id: '7'
                      - id: '20'
                      - id: '21'
                      - id: '22'
                      - id: '23'
                      - id: '24'
                      - id: '25'
                      - id: '26'
                      - id: '27'
                      - id: '28'
                      - id: '29'
                      - id: '30'
                      - id: '31'
                      - id: '32'
                      - id: '33'
                  inherited: 'false'
                  user_group_id:
                    id: '1'
                    name: All Users
                  disabled: 'false'
                  expired: 'false'
                  department: department 12
                  user_title: title
                  idx_user_id: '1001'
                  idx_user_id_num: '1001'
                  idx_name: '2001'
                  idx_phone: '1001'
                  idx_email: '5001'
                  fingerprint_template_count: '0'
                  face_count: '0'
                  card_count: '0'
                  access_groups:
                    - id: '1'
                      name: Meeting Room 1 AG
                    - id: '2'
                      name: Meeting Room 2 AG
                    - id: '22'
                      name: Building Access
                  user_custom_fields:
                    - user_id:
                        user_id: '1'
                        name: Administrator
                      custom_field:
                        id: '1'
                        name: Test
                        type: '0'
                        order: '1'
                    - user_id:
                        user_id: '1'
                        name: Administrator
                      custom_field:
                        id: '2'
                        name: '33'
                        type: '0'
                        order: '2'
                  need_to__pw: 'false'
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: Success
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/login \
              --header 'content-type: application/json' \
              --data '{"User":{"login_id":"string","password":"string"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"User":{"login_id":"string","password":"string"}}' |  \
              http POST https://{baseurl}/api/login \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'content-type: application/json' \
              --body-data '{"User":{"login_id":"string","password":"string"}}' \
              --output-document \
              - https://{baseurl}/api/login
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/login",
              "headers": {
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({User: {login_id: 'string', password:
            'string'}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/login',
              headers: {'content-type': 'application/json'},
              body: {User: {login_id: 'string', password: 'string'}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/login");

            req.headers({
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "User": {
                "login_id": "string",
                "password": "string"
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/login',
              headers: {'content-type': 'application/json'},
              data: {User: {login_id: 'string', password: 'string'}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/login';

            let options = {
              method: 'POST',
              headers: {'content-type': 'application/json'},
              body: '{"User":{"login_id":"string","password":"string"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'content-type': 'application/json'},
              body: '{"User":{"login_id":"string","password":"string"}}'
            };

            fetch('https://{baseurl}/api/login', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/login",
              "method": "POST",
              "headers": {
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "User": {
                "login_id": "string",
                "password": "string"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/login");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}"


            headers = { 'content-type': "application/json" }


            conn.request("POST", "{baseurl}/api/login", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/login"


            payload = {"User": {
                    "login_id": "string",
                    "password": "string"
                }}
            headers = {"content-type": "application/json"}


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/login")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["content-type"] = 'application/json'

            request.body =
            "{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/login",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}",
              CURLOPT_HTTPHEADER => [
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/login');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"User":{"login_id":"string","password":"string"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"User":{"login_id":"string","password":"string"}}');

            $request->setRequestUrl('https://{baseurl}/api/login');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/login")
              .post(body)
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/login")
              .header("content-type", "application/json")
              .body("{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/login\"\n\n\tpayload := strings.NewReader(\"{\\\"User\\\":{\\\"login_id\\\":\\\"string\\\",\\\"password\\\":\\\"string\\\"}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL, "https://{baseurl}/api/login");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"content-type": @"application/json" };

            NSDictionary *parameters = @{ @"User": @{ @"login_id": @"string",
            @"password": @"string" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL URLWithString:@"https://{baseurl}/api/login"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["content-type": "application/json"]

            let parameters = ["User": [
                "login_id": "string",
                "password": "string"
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/login")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/login");

            var request = new RestRequest(Method.POST);

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/login"),
                Content = new StringContent("{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/login'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"User":{"login_id":"string","password":"string"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/login'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"User":{"login_id":"string","password":"string"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/login"


            payload <-
            "{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/login" in

            let headers = Header.add (Header.init ()) "content-type"
            "application/json" in

            let body = Cohttp_lwt_body.of_string
            "{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"User\":{\"login_id\":\"string\",\"password\":\"string\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/login")
              .post(body)
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/logout:
    post:
      tags:
        - Authorization
      summary: Logout
      operationId: logout
      description: >-
        This API is used to Logout from the current session. There are no body
        parameter on this endpoint.

        It is required to have `bs-session-id` key on the header, the value
        generated on successful login.

        **Known errors:**

        - Placing "/" at the end of the endpoint
      requestBody:
        content: {}
      responses:
        '200':
          description: OK
          headers:
            Status:
              schema:
                type: string
                example: 200 OK
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            X-XSS-Protection:
              schema:
                type: integer
                example: 1
            Cache-Control:
              schema:
                type: string
                example: no-cache, no-store, max-age=0, must-revalidate
            Pragma:
              schema:
                type: string
                example: no-cache
            Expires:
              schema:
                type: integer
                example: 0
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000 ; includeSubDomains
            X-Frame-Options:
              schema:
                type: string
                example: SAMEORIGIN
            Content-Type:
              schema:
                type: string
                example: application/json
            Content-Length:
              schema:
                type: integer
                example: 107
            Date:
              schema:
                type: string
                example: Tue, 21 Jan 2025 07:59:20 GMT
            Keep-Alive:
              schema:
                type: string
                example: timeout=5
            Connection:
              schema:
                type: string
                example: keep-alive
          content:
            application/json:
              schema:
                type: object
              example:
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: Success
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/logout \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http POST https://{baseurl}/api/logout \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/logout
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/logout",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/logout',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/logout");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/logout',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/logout';


            let options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/logout', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/logout",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/logout");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("POST", "{baseurl}/api/logout", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/logout"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("POST", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/logout")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/logout",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/logout');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/logout');
            $request->setRequestMethod('POST');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/logout")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/logout")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/logout\"\n\n\treq, _ := http.NewRequest(\"POST\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL, "https://{baseurl}/api/logout");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL URLWithString:@"https://{baseurl}/api/logout"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/logout")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/logout");
            var request = new RestRequest(Method.POST);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/logout"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/logout'
            -Method POST -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/logout'
            -Method POST -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/logout"


            response <- VERB("POST", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/logout" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/logout")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/access_groups:
    post:
      tags:
        - Access Group
      summary: Create New Access Group
      operationId: createAccessGroup
      description: >-
        This request is used to make a new Access Group (AG).


        **Note:** If BioStar X does not have license for Elevator module, skip
        the floor_levels parameter or set it to an empty string.


        **Known errors:**

        - Placing "/" at the end of the endpoint - `name` is a required and
        unique parameter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - AccessGroup
              properties:
                AccessGroup:
                  type: object
                  required:
                    - name
                  properties:
                    name:
                      type: string
                      description: The name of the AG. Must be unique
                    description:
                      type: string
                      description: AG's description
                    users:
                      type: array
                      description: List of user(s) id of the AG
                      items:
                        type: object
                        properties:
                          user_id:
                            type: integer
                    user_groups:
                      type: array
                      description: List of user group(s) id of the AG
                      items:
                        type: object
                        properties:
                          id:
                            type: integer
                    access_levels:
                      type: array
                      description: List of access level(s) id of the AG
                      items:
                        type: object
                        properties:
                          id:
                            type: integer
                    floor_levels:
                      type: array
                      description: List of floor level(s) id of the AG
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type: string
            example:
              AccessGroup:
                name: ac_grp2
                description: ''
                users:
                  - user_id: 1
                user_groups:
                  - id: 1
                access_levels:
                  - id: 2
                floor_levels:
                  - id: '32769'
                    name: floor_test
      responses:
        '200':
          description: OK
          headers:
            Status:
              schema:
                type: string
                example: 200 OK
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            X-XSS-Protection:
              schema:
                type: integer
                example: 1
            Cache-Control:
              schema:
                type: string
                example: no-cache, no-store, max-age=0, must-revalidate
            Pragma:
              schema:
                type: string
                example: no-cache
            Expires:
              schema:
                type: integer
                example: 0
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000 ; includeSubDomains
            X-Frame-Options:
              schema:
                type: string
                example: SAMEORIGIN
            Content-Type:
              schema:
                type: string
                example: application/json
            Content-Length:
              schema:
                type: integer
                example: 1644
            Date:
              schema:
                type: string
                example: Mon, 17 Feb 2025 07:52:34 GMT
            Keep-Alive:
              schema:
                type: string
                example: timeout=5
            Connection:
              schema:
                type: string
                example: keep-alive
          content:
            application/json:
              schema:
                type: object
                properties:
                  AccessGroup:
                    type: object
                    description: AccessGroup object
                    properties:
                      id:
                        type: string
                        description: ID of the Access Group which was created
                      name:
                        type: string
                        description: Name of the Access Group which was created
                  DeviceResponse:
                    $ref: '#/components/schemas/DeviceResponse'
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
              example:
                AccessGroup:
                  id: '14'
                  name: Test1
                DeviceResponse:
                  rows:
                    - id: '40059001'
                      code: '0'
                    - id: '40059002'
                      code: '0'
                  result: 'true'
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: Success
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/access_groups \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}]}}'
            |  \
              http POST https://{baseurl}/api/access_groups \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}]}}' \
              --output-document \
              - https://{baseurl}/api/access_groups
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/access_groups",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              AccessGroup: {
                name: 'string',
                description: 'string',
                users: [{user_id: 0}],
                user_groups: [{id: 0}],
                access_levels: [{id: 0}],
                floor_levels: [{id: 'string', name: 'string'}]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/access_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                AccessGroup: {
                  name: 'string',
                  description: 'string',
                  users: [{user_id: 0}],
                  user_groups: [{id: 0}],
                  access_levels: [{id: 0}],
                  floor_levels: [{id: 'string', name: 'string'}]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/access_groups");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "AccessGroup": {
                "name": "string",
                "description": "string",
                "users": [
                  {
                    "user_id": 0
                  }
                ],
                "user_groups": [
                  {
                    "id": 0
                  }
                ],
                "access_levels": [
                  {
                    "id": 0
                  }
                ],
                "floor_levels": [
                  {
                    "id": "string",
                    "name": "string"
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/access_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                AccessGroup: {
                  name: 'string',
                  description: 'string',
                  users: [{user_id: 0}],
                  user_groups: [{id: 0}],
                  access_levels: [{id: 0}],
                  floor_levels: [{id: 'string', name: 'string'}]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/access_groups';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}]}}'
            };

            fetch('https://{baseurl}/api/access_groups', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/access_groups",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "AccessGroup": {
                "name": "string",
                "description": "string",
                "users": [
                  {
                    "user_id": 0
                  }
                ],
                "user_groups": [
                  {
                    "id": 0
                  }
                ],
                "access_levels": [
                  {
                    "id": 0
                  }
                ],
                "floor_levels": [
                  {
                    "id": "string",
                    "name": "string"
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/access_groups");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/access_groups", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/access_groups"


            payload = {"AccessGroup": {
                    "name": "string",
                    "description": "string",
                    "users": [{"user_id": 0}],
                    "user_groups": [{"id": 0}],
                    "access_levels": [{"id": 0}],
                    "floor_levels": [
                        {
                            "id": "string",
                            "name": "string"
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/access_groups")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/access_groups",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/access_groups');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}]}}');


            $request->setRequestUrl('https://{baseurl}/api/access_groups');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/access_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/access_groups")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/access_groups\"\n\n\tpayload := strings.NewReader(\"{\\\"AccessGroup\\\":{\\\"name\\\":\\\"string\\\",\\\"description\\\":\\\"string\\\",\\\"users\\\":[{\\\"user_id\\\":0}],\\\"user_groups\\\":[{\\\"id\\\":0}],\\\"access_levels\\\":[{\\\"id\\\":0}],\\\"floor_levels\\\":[{\\\"id\\\":\\\"string\\\",\\\"name\\\":\\\"string\\\"}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/access_groups");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"AccessGroup": @{ @"name": @"string",
            @"description": @"string", @"users": @[ @{ @"user_id": @0 } ],
            @"user_groups": @[ @{ @"id": @0 } ], @"access_levels": @[ @{ @"id":
            @0 } ], @"floor_levels": @[ @{ @"id": @"string", @"name": @"string"
            } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/access_groups"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["AccessGroup": [
                "name": "string",
                "description": "string",
                "users": [["user_id": 0]],
                "user_groups": [["id": 0]],
                "access_levels": [["id": 0]],
                "floor_levels": [
                  [
                    "id": "string",
                    "name": "string"
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/access_groups")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/access_groups");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/access_groups"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/access_groups' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/access_groups' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/access_groups"


            payload <-
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/access_groups" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/access_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Access Group
      summary: List All Access Group
      operationId: listAccessGroup
      description: |-
        This API is used to view all available Access Groups.

        By default the result will be sorted ascending by `id`.
      responses:
        '200':
          description: OK
          headers:
            Status:
              schema:
                type: string
                example: 200 OK
            Set-Cookie:
              schema:
                type: string
                example: >-
                  JSESSIONID=BEDFE7BF63ADDBD1A0B5B4E36C9F50D7; Path=/; Secure;
                  HttpOnly
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            X-XSS-Protection:
              schema:
                type: integer
                example: 1
            Cache-Control:
              schema:
                type: string
                example: no-cache, no-store, max-age=0, must-revalidate
            Pragma:
              schema:
                type: string
                example: no-cache
            Expires:
              schema:
                type: integer
                example: 0
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000 ; includeSubDomains
            X-Frame-Options:
              schema:
                type: string
                example: SAMEORIGIN
            Content-Type:
              schema:
                type: string
                example: application/json
            Content-Length:
              schema:
                type: integer
                example: 4149
            Date:
              schema:
                type: string
                example: Mon, 17 Feb 2025 07:34:09 GMT
            Keep-Alive:
              schema:
                type: string
                example: timeout=5
            Connection:
              schema:
                type: string
                example: keep-alive
          content:
            application/json:
              schema:
                type: object
                properties:
                  AccessGroupCollection:
                    type: object
                    description: Collection of Access Groups
                    properties:
                      total:
                        type: string
                        description: Total number of access groups
                      rows:
                        type: array
                        description: Array of access group objects
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Access group ID
                            name:
                              type: string
                              description: Access group name
                            description:
                              type: string
                              description: Access group description
                            users:
                              type: array
                              description: List of users in the access group
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                                    description: User name
                                  user_id:
                                    type: string
                                    description: User ID
                            user_count:
                              type: string
                              description: Total number of users in the access group
                            user_groups:
                              type: array
                              description: List of user groups in the access group
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    description: User group ID
                                  name:
                                    type: string
                                    description: User group name
                                  description:
                                    type: string
                                    description: User group description
                                  parent_id:
                                    type: object
                                    description: Parent group information
                                    properties:
                                      id:
                                        type: string
                                        description: Parent group ID
                                      name:
                                        type: string
                                        description: Parent group name
                                  depth:
                                    type: string
                                    description: Group hierarchy depth
                                  inherited:
                                    type: string
                                    description: Whether access is inherited
                                  face_count:
                                    type: string
                                    description: Number of face templates
                                  user_count:
                                    type: string
                                    description: Number of users in the group
                                  user_groups:
                                    type: array
                                    description: Nested user groups
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                        name:
                                          type: string
                            access_levels:
                              type: array
                              description: List of access levels
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    description: Access level ID
                                  name:
                                    type: string
                                    description: Access level name
                                  description:
                                    type: string
                                    description: Access level description
                            floor_levels:
                              type: array
                              description: List of floor levels (elevator module)
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    description: Floor level ID
                                  name:
                                    type: string
                                    description: Floor level name
                                  description:
                                    type: string
                                    description: Floor level description
                  Response:
                    type: object
                    description: Response information
                    properties:
                      code:
                        type: string
                        description: Response code
                      link:
                        type: string
                        description: Support link
                      message:
                        type: string
                        description: Response message
              example:
                AccessGroupCollection:
                  total: '3'
                  rows:
                    - id: '1'
                      name: Adminstrative
                      description: Administrative access group
                      users:
                        - name: RB
                          user_id: '2'
                        - name: AM
                          user_id: '3'
                      user_count: '2'
                      user_groups:
                        - id: '1005'
                          name: Administrative
                          description: Administrative user group
                          parent_id:
                            id: '1'
                            name: All Users
                          depth: '1'
                          inherited: 'true'
                          face_count: '0'
                          user_count: '241'
                      access_levels:
                        - id: '1'
                          name: Administrative Employee
                          description: Access level for Administrative Employee
                    - id: '2'
                      name: Executive
                      description: Executive access group
                      users:
                        - name: Sib Steketee
                          user_id: '60014'
                      user_count: '1'
                      user_groups:
                        - id: '1004'
                          name: Executive
                          description: Executive user group
                          parent_id:
                            id: '1'
                            name: All Users
                          depth: '1'
                          inherited: 'true'
                          face_count: '0'
                          user_count: '15'
                      access_levels:
                        - id: '2'
                          name: Executive
                          description: Access level for Executive
                    - id: '3'
                      name: Test1
                      description: Test access group with floor levels
                      user_count: '0'
                      user_groups:
                        - id: '1005'
                          name: Administrative
                          description: Administrative user group
                          parent_id:
                            id: '1'
                            name: All Users
                          depth: '1'
                          inherited: 'true'
                          face_count: '0'
                          user_count: '241'
                      access_levels:
                        - id: '3'
                          name: All Access
                          description: Access level for All Access
                      floor_levels:
                        - id: '32769'
                          name: FL1
                          description: First floor
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: Success
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/access_groups \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/access_groups \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/access_groups
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/access_groups",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/access_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/access_groups");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/access_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/access_groups';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/access_groups', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/access_groups",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/access_groups");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/access_groups", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/access_groups"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/access_groups")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/access_groups",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/access_groups');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/access_groups');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/access_groups")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/access_groups")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/access_groups\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/access_groups");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/access_groups"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/access_groups")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/access_groups");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/access_groups"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/access_groups' -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/access_groups' -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/access_groups"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/access_groups" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/access_groups")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Access Group
      summary: Delete an Access Group
      operationId: deleteAccessGroup
      description: >-
        Delete an Access Group specified by the **id** query parameter.


        **Note:** The id parameter is required and must be a valid access group
        ID.


        To get an Access Group's id, you can use `GET /api/access_groups` to
        view all available Access Groups.


        **Known errors:**

        - Using id which doesn't exist - Using value other than number
      parameters:
        - name: id
          in: query
          required: true
          schema:
            type: string
          description: ID of the Access Group to be deleted
          example: '12'
      responses:
        '200':
          description: OK
          headers:
            Status:
              schema:
                type: string
                example: 200 OK
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            X-XSS-Protection:
              schema:
                type: integer
                example: 1
            Cache-Control:
              schema:
                type: string
                example: no-cache, no-store, max-age=0, must-revalidate
            Pragma:
              schema:
                type: string
                example: no-cache
            Expires:
              schema:
                type: integer
                example: 0
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000 ; includeSubDomains
            X-Frame-Options:
              schema:
                type: string
                example: SAMEORIGIN
            Content-Type:
              schema:
                type: string
                example: application/json
            Content-Length:
              schema:
                type: integer
                example: 107
            Date:
              schema:
                type: string
                example: Mon, 17 Feb 2025 07:24:47 GMT
            Keep-Alive:
              schema:
                type: string
                example: timeout=5
            Connection:
              schema:
                type: string
                example: keep-alive
          content:
            application/json:
              schema:
                type: object
                properties:
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
              example:
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: Success
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/access_groups?id=12' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE 'https://{baseurl}/api/access_groups?id=12' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/access_groups?id=12'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/access_groups?id=12",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/access_groups',
              qs: {id: '12'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/access_groups");


            req.query({
              "id": "12"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/access_groups',
              params: {id: '12'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/access_groups?id=12';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/access_groups?id=12', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/access_groups?id=12",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/access_groups?id=12");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/access_groups?id=12",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/access_groups"


            querystring = {"id":"12"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/access_groups?id=12")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/access_groups?id=12",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/access_groups');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => '12'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/access_groups');
            $request->setRequestMethod('DELETE');
            $request->setQuery(new http\QueryString([
              'id' => '12'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/access_groups?id=12")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/access_groups?id=12")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/access_groups?id=12\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/access_groups?id=12");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/access_groups?id=12"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/access_groups?id=12")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/access_groups?id=12");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/access_groups?id=12"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/access_groups?id=12' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/access_groups?id=12' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/access_groups"


            queryString <- list([ 'id' ] = "12")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/access_groups?id=12"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/access_groups?id=12")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/access_groups/search:
    post:
      tags:
        - Access Group
      summary: List All Access Group v2
      operationId: searchAccessGroups
      description: >-
        This API is used to see all Access Groups. It provides more concise
        response rather than the previous (`GET /api/access_groups`) and
        parameters to filter the response.


        **Known errors:**

        - Empty body

        - Input other than number on limit parameter

        - Input without key:value pair (name:val or id:val) on order_by
        parameter


        **Changes:**

        - v2.9.9:

          Trailing slashes (/) at the end of this endpoint are no longer supported.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - limit
                - order_by
              properties:
                limit:
                  type: integer
                  description: To limit result by n record(s), 0 to show all
                  example: 0
                order_by:
                  type: string
                  description: >-
                    To order result(s) by `name` or `id`. Format -
                    field:direction (false=ascending, true=descending)
                  pattern: ^(name|id):(true|false)$
                  example: id:false
            example:
              limit: 0
              order_by: id:false
      responses:
        '200':
          description: OK
          headers:
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            X-XSS-Protection:
              schema:
                type: integer
                example: 1
            Cache-Control:
              schema:
                type: string
                example: no-cache, no-store, max-age=0, must-revalidate
            Pragma:
              schema:
                type: string
                example: no-cache
            Expires:
              schema:
                type: integer
                example: 0
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000 ; includeSubDomains
            X-Frame-Options:
              schema:
                type: string
                example: SAMEORIGIN
            Content-Type:
              schema:
                type: string
                example: application/json
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Date:
              schema:
                type: string
                example: Mon, 17 Feb 2025 07:34:24 GMT
            Keep-Alive:
              schema:
                type: string
                example: timeout=5
            Connection:
              schema:
                type: string
                example: keep-alive
          content:
            application/json:
              schema:
                type: object
                properties:
                  AccessGroupCollection:
                    $ref: '#/components/schemas/AccessGroupSearchResult'
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
              example:
                AccessGroupCollection:
                  total: 3
                  rows:
                    - id: 1
                      name: Administrative
                      users:
                        - user_id: '2'
                          name: RB
                        - user_id: '3'
                          name: AM
                      user_groups:
                        - id: 1005
                          name: Administrative
                      access_levels:
                        - id: 1
                          name: Administrative Employee
                      floor_levels: []
                    - id: 2
                      name: Executive
                      users:
                        - user_id: '60014'
                          name: Sib Steketee
                      user_groups:
                        - id: 1004
                          name: Executive
                      access_levels:
                        - id: 2
                          name: Executive
                      floor_levels: []
                    - id: 12
                      name: Test1
                      users: []
                      user_groups:
                        - id: 1005
                          name: Administrative
                      access_levels:
                        - id: 3
                          name: All Access
                      floor_levels:
                        - id: 32769
                          name: FL1
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: Success
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/access_groups/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"limit":0,"order_by":"id:false"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"limit":0,"order_by":"id:false"}' |  \
              http POST https://{baseurl}/api/v2/access_groups/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"limit":0,"order_by":"id:false"}' \
              --output-document \
              - https://{baseurl}/api/v2/access_groups/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/access_groups/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({limit: 0, order_by: 'id:false'}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/access_groups/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {limit: 0, order_by: 'id:false'},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/access_groups/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "limit": 0,
              "order_by": "id:false"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/access_groups/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {limit: 0, order_by: 'id:false'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/access_groups/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":0,"order_by":"id:false"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":0,"order_by":"id:false"}'
            };

            fetch('https://{baseurl}/api/v2/access_groups/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/access_groups/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"limit\":0,\"order_by\":\"id:false\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "limit": 0,
              "order_by": "id:false"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/access_groups/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"limit\":0,\"order_by\":\"id:false\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/access_groups/search",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/access_groups/search"


            payload = {
                "limit": 0,
                "order_by": "id:false"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/access_groups/search")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"limit\":0,\"order_by\":\"id:false\"}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/access_groups/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"limit\":0,\"order_by\":\"id:false\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/access_groups/search');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"limit":0,"order_by":"id:false"}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"limit":0,"order_by":"id:false"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/access_groups/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"limit\":0,\"order_by\":\"id:false\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/access_groups/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/access_groups/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"limit\":0,\"order_by\":\"id:false\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/access_groups/search\"\n\n\tpayload := strings.NewReader(\"{\\\"limit\\\":0,\\\"order_by\\\":\\\"id:false\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/access_groups/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"limit\":0,\"order_by\":\"id:false\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"limit": @0,
                                          @"order_by": @"id:false" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/access_groups/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "limit": 0,
              "order_by": "id:false"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/access_groups/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/access_groups/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"limit\":0,\"order_by\":\"id:false\"}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/access_groups/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"limit\":0,\"order_by\":\"id:false\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/access_groups/search' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"limit":0,"order_by":"id:false"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/access_groups/search' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"limit":0,"order_by":"id:false"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/access_groups/search"


            payload <- "{\"limit\":0,\"order_by\":\"id:false\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/access_groups/search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"limit\":0,\"order_by\":\"id:false\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"limit\":0,\"order_by\":\"id:false\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/access_groups/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/access_groups/{id}:
    get:
      tags:
        - Access Group
      summary: View an Access Group
      operationId: viewAccessGroup
      description: >-
        To view an Access Group with id {id} or :id   {id} or :id are markers
        for replacing with the required value.


        **Known errors:**

        - Using id which doesn't exist

        - Using value other than number

        - Placing "/" at the end of the endpoint
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Access Group to retrieve
          example: 1
      responses:
        '200':
          description: OK
          headers:
            Status:
              schema:
                type: string
                example: 200 OK
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            X-XSS-Protection:
              schema:
                type: integer
                example: 1
            Cache-Control:
              schema:
                type: string
                example: no-cache, no-store, max-age=0, must-revalidate
            Pragma:
              schema:
                type: string
                example: no-cache
            Expires:
              schema:
                type: integer
                example: 0
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000 ; includeSubDomains
            X-Frame-Options:
              schema:
                type: string
                example: SAMEORIGIN
            Content-Type:
              schema:
                type: string
                example: application/json
            Content-Length:
              schema:
                type: integer
                example: 584
            Date:
              schema:
                type: string
                example: Mon, 17 Feb 2025 07:44:02 GMT
            Keep-Alive:
              schema:
                type: string
                example: timeout=5
            Connection:
              schema:
                type: string
                example: keep-alive
          content:
            application/json:
              schema:
                type: object
                properties:
                  AccessGroup:
                    $ref: '#/components/schemas/AccessGroupDetail'
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
              examples:
                basic_access_group:
                  summary: Basic Access Group
                  value:
                    AccessGroup:
                      id: '1'
                      name: Administrative
                      description: Administrative access group
                      users:
                        - name: RB
                          user_id: '2'
                        - name: AM
                          user_id: '3'
                      user_count: '2'
                      user_groups:
                        - id: '1005'
                          name: Administrative
                          description: Administrative user group
                          parent_id:
                            id: '1'
                            name: All Users
                          depth: '1'
                          inherited: 'true'
                          face_count: '0'
                          user_count: '241'
                      access_levels:
                        - id: '1'
                          name: Administrative Employee
                          description: Access level for Administrative Employee
                    Response:
                      code: '0'
                      link: https://support.supremainc.com/en/support/home
                      message: Success
                with_floor_levels:
                  summary: Access Group with Floor Levels
                  value:
                    AccessGroup:
                      id: '12'
                      name: Test1
                      description: Test access group with elevator access
                      user_count: '0'
                      user_groups:
                        - id: '1005'
                          name: Administrative
                          description: Administrative user group
                          parent_id:
                            id: '1'
                            name: All Users
                          depth: '1'
                          inherited: 'true'
                          face_count: '0'
                          user_count: '241'
                      access_levels:
                        - id: '3'
                          name: All Access
                          description: Access level for All Access
                      floor_levels:
                        - id: '32769'
                          name: FL1
                          description: First floor access
                    Response:
                      code: '0'
                      link: https://support.supremainc.com/en/support/home
                      message: Success
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/access_groups/1 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/access_groups/1 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/access_groups/1
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/access_groups/1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/access_groups/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/access_groups/1");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/access_groups/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/access_groups/1';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/access_groups/1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/access_groups/1",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/access_groups/1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/access_groups/1",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/access_groups/1"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/access_groups/1")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/access_groups/1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/access_groups/1');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/access_groups/1');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/access_groups/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/access_groups/1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/access_groups/1\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/access_groups/1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/access_groups/1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/access_groups/1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/access_groups/1");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/access_groups/1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/access_groups/1' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/access_groups/1' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/access_groups/1"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/access_groups/1" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/access_groups/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    put:
      tags:
        - Access Group
      summary: Update an Access Group
      operationId: updateAccessGroup
      description: >-
        Update an existing Access Group by replacing it with new data.


        **Notes:**

        - To add/delete multiple, repeat the braces (see users example)
            
        - When you add/update data, it will remove any previous data and add the
        one that you input.  
            
            Ex: If parameter description have value, and on update this parameter value is left empty, then the previous value will be removed.
            
        - To skip a record from updating, either skip the parameter or fill the
        current data on the update field.
            
        - When updating an AG, parameter `user_group` need to be filled if
        existing User Group want to be retained. If this parameter is left
        empty, the existing User Group(s) in the AG that should be still there
        will not be there.


        **Known Errors:**

        - Repeating the same value on parameter with multiple options
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - AccessGroup
              properties:
                AccessGroup:
                  $ref: '#/components/schemas/AccessGroupUpdate'
            example:
              AccessGroup:
                name: Meeting Room Name
                description: MR Description
                access_levels:
                  - id: 1
                user_groups:
                  - id: 1
                users:
                  - user_id: 17
                  - user_id: 9932
                  - user_id: 2
                new_users:
                  - user_id: 1
                delete_users:
                  - user_id: 17
                  - user_id: 9932
                  - user_id: 2
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Access Group which will be updated
          example: 1
      responses:
        '200':
          description: OK
          headers:
            Status:
              schema:
                type: string
                example: 200 OK
            Set-Cookie:
              schema:
                type: string
                example: >-
                  JSESSIONID=2FFEDBAE36C395555DECAFA23AA6205D; Path=/; Secure;
                  HttpOnly
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            X-XSS-Protection:
              schema:
                type: integer
                example: 1
            Cache-Control:
              schema:
                type: string
                example: no-cache, no-store, max-age=0, must-revalidate
            Pragma:
              schema:
                type: string
                example: no-cache
            Expires:
              schema:
                type: integer
                example: 0
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000 ; includeSubDomains
            X-Frame-Options:
              schema:
                type: string
                example: SAMEORIGIN
            Content-Type:
              schema:
                type: string
                example: application/json
            Content-Length:
              schema:
                type: integer
                example: 107
            Date:
              schema:
                type: string
                example: Tue, 04 Feb 2025 08:02:39 GMT
            Keep-Alive:
              schema:
                type: string
                example: timeout=5
            Connection:
              schema:
                type: string
                example: keep-alive
          content:
            application/json:
              schema:
                type: object
                properties:
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
              example:
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: Success
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/access_groups/1 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}],"new_users":[{"user_id":0}],"delete_users":[{"user_id":0}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}],"new_users":[{"user_id":0}],"delete_users":[{"user_id":0}]}}'
            |  \
              http PUT https://{baseurl}/api/access_groups/1 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}],"new_users":[{"user_id":0}],"delete_users":[{"user_id":0}]}}' \
              --output-document \
              - https://{baseurl}/api/access_groups/1
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/access_groups/1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              AccessGroup: {
                name: 'string',
                description: 'string',
                users: [{user_id: 0}],
                user_groups: [{id: 0}],
                access_levels: [{id: 0}],
                floor_levels: [{id: 'string', name: 'string'}],
                new_users: [{user_id: 0}],
                delete_users: [{user_id: 0}]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/access_groups/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                AccessGroup: {
                  name: 'string',
                  description: 'string',
                  users: [{user_id: 0}],
                  user_groups: [{id: 0}],
                  access_levels: [{id: 0}],
                  floor_levels: [{id: 'string', name: 'string'}],
                  new_users: [{user_id: 0}],
                  delete_users: [{user_id: 0}]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/access_groups/1");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "AccessGroup": {
                "name": "string",
                "description": "string",
                "users": [
                  {
                    "user_id": 0
                  }
                ],
                "user_groups": [
                  {
                    "id": 0
                  }
                ],
                "access_levels": [
                  {
                    "id": 0
                  }
                ],
                "floor_levels": [
                  {
                    "id": "string",
                    "name": "string"
                  }
                ],
                "new_users": [
                  {
                    "user_id": 0
                  }
                ],
                "delete_users": [
                  {
                    "user_id": 0
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/access_groups/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                AccessGroup: {
                  name: 'string',
                  description: 'string',
                  users: [{user_id: 0}],
                  user_groups: [{id: 0}],
                  access_levels: [{id: 0}],
                  floor_levels: [{id: 'string', name: 'string'}],
                  new_users: [{user_id: 0}],
                  delete_users: [{user_id: 0}]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/access_groups/1';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}],"new_users":[{"user_id":0}],"delete_users":[{"user_id":0}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}],"new_users":[{"user_id":0}],"delete_users":[{"user_id":0}]}}'
            };

            fetch('https://{baseurl}/api/access_groups/1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/access_groups/1",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "AccessGroup": {
                "name": "string",
                "description": "string",
                "users": [
                  {
                    "user_id": 0
                  }
                ],
                "user_groups": [
                  {
                    "id": 0
                  }
                ],
                "access_levels": [
                  {
                    "id": 0
                  }
                ],
                "floor_levels": [
                  {
                    "id": "string",
                    "name": "string"
                  }
                ],
                "new_users": [
                  {
                    "user_id": 0
                  }
                ],
                "delete_users": [
                  {
                    "user_id": 0
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/access_groups/1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/access_groups/1", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/access_groups/1"


            payload = {"AccessGroup": {
                    "name": "string",
                    "description": "string",
                    "users": [{"user_id": 0}],
                    "user_groups": [{"id": 0}],
                    "access_levels": [{"id": 0}],
                    "floor_levels": [
                        {
                            "id": "string",
                            "name": "string"
                        }
                    ],
                    "new_users": [{"user_id": 0}],
                    "delete_users": [{"user_id": 0}]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/access_groups/1")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/access_groups/1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/access_groups/1');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}],"new_users":[{"user_id":0}],"delete_users":[{"user_id":0}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}],"new_users":[{"user_id":0}],"delete_users":[{"user_id":0}]}}');


            $request->setRequestUrl('https://{baseurl}/api/access_groups/1');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/access_groups/1")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/access_groups/1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/access_groups/1\"\n\n\tpayload := strings.NewReader(\"{\\\"AccessGroup\\\":{\\\"name\\\":\\\"string\\\",\\\"description\\\":\\\"string\\\",\\\"users\\\":[{\\\"user_id\\\":0}],\\\"user_groups\\\":[{\\\"id\\\":0}],\\\"access_levels\\\":[{\\\"id\\\":0}],\\\"floor_levels\\\":[{\\\"id\\\":\\\"string\\\",\\\"name\\\":\\\"string\\\"}],\\\"new_users\\\":[{\\\"user_id\\\":0}],\\\"delete_users\\\":[{\\\"user_id\\\":0}]}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/access_groups/1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"AccessGroup": @{ @"name": @"string",
            @"description": @"string", @"users": @[ @{ @"user_id": @0 } ],
            @"user_groups": @[ @{ @"id": @0 } ], @"access_levels": @[ @{ @"id":
            @0 } ], @"floor_levels": @[ @{ @"id": @"string", @"name": @"string"
            } ], @"new_users": @[ @{ @"user_id": @0 } ], @"delete_users": @[ @{
            @"user_id": @0 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/access_groups/1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["AccessGroup": [
                "name": "string",
                "description": "string",
                "users": [["user_id": 0]],
                "user_groups": [["id": 0]],
                "access_levels": [["id": 0]],
                "floor_levels": [
                  [
                    "id": "string",
                    "name": "string"
                  ]
                ],
                "new_users": [["user_id": 0]],
                "delete_users": [["user_id": 0]]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/access_groups/1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/access_groups/1");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/access_groups/1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/access_groups/1' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}],"new_users":[{"user_id":0}],"delete_users":[{"user_id":0}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/access_groups/1' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"AccessGroup":{"name":"string","description":"string","users":[{"user_id":0}],"user_groups":[{"id":0}],"access_levels":[{"id":0}],"floor_levels":[{"id":"string","name":"string"}],"new_users":[{"user_id":0}],"delete_users":[{"user_id":0}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/access_groups/1"


            payload <-
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/access_groups/1" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"AccessGroup\":{\"name\":\"string\",\"description\":\"string\",\"users\":[{\"user_id\":0}],\"user_groups\":[{\"id\":0}],\"access_levels\":[{\"id\":0}],\"floor_levels\":[{\"id\":\"string\",\"name\":\"string\"}],\"new_users\":[{\"user_id\":0}],\"delete_users\":[{\"user_id\":0}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/access_groups/1")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/access_groups/{id}/users:
    get:
      tags:
        - Access Group
      summary: View List of Users from an Access Group
      operationId: getAccessGroupUsers
      description: |-
        To view user information only from AG with id {id}
        **Known errors:**
        - Using id which doesn't exist will return success but show no record
            
        - Using value other than number
            
        - Placing "/" at the end of the endpoint
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Access Group to retrieve users from
          example: 1
      responses:
        '200':
          description: OK
          headers:
            Status:
              schema:
                type: string
                example: 200 OK
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            X-XSS-Protection:
              schema:
                type: integer
                example: 1
            Cache-Control:
              schema:
                type: string
                example: no-cache, no-store, max-age=0, must-revalidate
            Pragma:
              schema:
                type: string
                example: no-cache
            Expires:
              schema:
                type: integer
                example: 0
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000 ; includeSubDomains
            X-Frame-Options:
              schema:
                type: string
                example: SAMEORIGIN
            Content-Type:
              schema:
                type: string
                example: application/json
            Content-Length:
              schema:
                type: integer
                example: 235
            Date:
              schema:
                type: string
                example: Mon, 17 Feb 2025 07:47:24 GMT
            Keep-Alive:
              schema:
                type: string
                example: timeout=5
            Connection:
              schema:
                type: string
                example: keep-alive
          content:
            application/json:
              schema:
                type: object
                properties:
                  UserCollection:
                    $ref: '#/components/schemas/UserCollection'
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
              example:
                UserCollection:
                  total: '3'
                  rows:
                    - user_id: '2'
                      name: RB
                    - user_id: '3'
                      name: AM
                    - user_id: '61000'
                      name: JJ
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: Success
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/access_groups/1/users \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/access_groups/1/users \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/access_groups/1/users
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/access_groups/1/users",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/access_groups/1/users',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/access_groups/1/users");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/access_groups/1/users',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/access_groups/1/users';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/access_groups/1/users', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/access_groups/1/users",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/access_groups/1/users");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/access_groups/1/users",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/access_groups/1/users"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/access_groups/1/users")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/access_groups/1/users",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/access_groups/1/users');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/access_groups/1/users');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/access_groups/1/users")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/access_groups/1/users")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/access_groups/1/users\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/access_groups/1/users");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/access_groups/1/users"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/access_groups/1/users")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/access_groups/1/users");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/access_groups/1/users"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/access_groups/1/users' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/access_groups/1/users' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/access_groups/1/users"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/access_groups/1/users" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/access_groups/1/users")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/access_levels:
    post:
      tags:
        - Access Level
      summary: Create New Access Level
      operationId: createAccessLevel
      description: |-
        Create a new Access Level (AL) with doors and schedule configuration.

        **Important Notes:**
        - Access level items link doors with schedules
        - Multiple doors can be assigned to the same schedule
        - Each door can only appear once in the access level items

        **Known errors:**
        - Placing "/" at the end of the endpoint
        - `name` is a required and unique parameter
        - Duplicate id on doors instance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - AccessLevel
              properties:
                AccessLevel:
                  $ref: '#/components/schemas/AccessLevelInput'
            example:
              AccessLevel:
                name: Access Level Name
                description: Access Level Description
                access_level_items:
                  - doors:
                      - id: 75
                      - id: 80
                    schedule_id:
                      id: '1'
      responses:
        '200':
          description: Access Level created successfully
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/access_levels \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"AccessLevel":{"name":"string","description":"string","access_level_items":[{"doors":[{"id":0}],"schedule_id":{"id":"string"}}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"AccessLevel":{"name":"string","description":"string","access_level_items":[{"doors":[{"id":0}],"schedule_id":{"id":"string"}}]}}'
            |  \
              http POST https://{baseurl}/api/access_levels \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"AccessLevel":{"name":"string","description":"string","access_level_items":[{"doors":[{"id":0}],"schedule_id":{"id":"string"}}]}}' \
              --output-document \
              - https://{baseurl}/api/access_levels
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/access_levels",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              AccessLevel: {
                name: 'string',
                description: 'string',
                access_level_items: [{doors: [{id: 0}], schedule_id: {id: 'string'}}]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/access_levels',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                AccessLevel: {
                  name: 'string',
                  description: 'string',
                  access_level_items: [{doors: [{id: 0}], schedule_id: {id: 'string'}}]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/access_levels");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "AccessLevel": {
                "name": "string",
                "description": "string",
                "access_level_items": [
                  {
                    "doors": [
                      {
                        "id": 0
                      }
                    ],
                    "schedule_id": {
                      "id": "string"
                    }
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/access_levels',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                AccessLevel: {
                  name: 'string',
                  description: 'string',
                  access_level_items: [{doors: [{id: 0}], schedule_id: {id: 'string'}}]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/access_levels';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AccessLevel":{"name":"string","description":"string","access_level_items":[{"doors":[{"id":0}],"schedule_id":{"id":"string"}}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AccessLevel":{"name":"string","description":"string","access_level_items":[{"doors":[{"id":0}],"schedule_id":{"id":"string"}}]}}'
            };

            fetch('https://{baseurl}/api/access_levels', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/access_levels",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "AccessLevel": {
                "name": "string",
                "description": "string",
                "access_level_items": [
                  {
                    "doors": [
                      {
                        "id": 0
                      }
                    ],
                    "schedule_id": {
                      "id": "string"
                    }
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/access_levels");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/access_levels", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/access_levels"


            payload = {"AccessLevel": {
                    "name": "string",
                    "description": "string",
                    "access_level_items": [
                        {
                            "doors": [{"id": 0}],
                            "schedule_id": {"id": "string"}
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/access_levels")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/access_levels",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/access_levels');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"AccessLevel":{"name":"string","description":"string","access_level_items":[{"doors":[{"id":0}],"schedule_id":{"id":"string"}}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"AccessLevel":{"name":"string","description":"string","access_level_items":[{"doors":[{"id":0}],"schedule_id":{"id":"string"}}]}}');


            $request->setRequestUrl('https://{baseurl}/api/access_levels');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/access_levels")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/access_levels")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/access_levels\"\n\n\tpayload := strings.NewReader(\"{\\\"AccessLevel\\\":{\\\"name\\\":\\\"string\\\",\\\"description\\\":\\\"string\\\",\\\"access_level_items\\\":[{\\\"doors\\\":[{\\\"id\\\":0}],\\\"schedule_id\\\":{\\\"id\\\":\\\"string\\\"}}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/access_levels");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"AccessLevel": @{ @"name": @"string",
            @"description": @"string", @"access_level_items": @[ @{ @"doors": @[
            @{ @"id": @0 } ], @"schedule_id": @{ @"id": @"string" } } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/access_levels"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["AccessLevel": [
                "name": "string",
                "description": "string",
                "access_level_items": [
                  [
                    "doors": [["id": 0]],
                    "schedule_id": ["id": "string"]
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/access_levels")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/access_levels");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/access_levels"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/access_levels' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"AccessLevel":{"name":"string","description":"string","access_level_items":[{"doors":[{"id":0}],"schedule_id":{"id":"string"}}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/access_levels' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"AccessLevel":{"name":"string","description":"string","access_level_items":[{"doors":[{"id":0}],"schedule_id":{"id":"string"}}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/access_levels"


            payload <-
            "{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/access_levels" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"AccessLevel\":{\"name\":\"string\",\"description\":\"string\",\"access_level_items\":[{\"doors\":[{\"id\":0}],\"schedule_id\":{\"id\":\"string\"}}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/access_levels")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Access Level
      summary: View All Access Level
      operationId: listAccessLevel
      description: |-
        This request is used to view all Access Level (AL)

        The parameter type is QUERY.

        **Known errors:**

        - Duplicate id on doors instance
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
          description: >-
            Limit response record(s) by the amount specified on this parameter.
            0 for show all.
          example: 50
        - name: offset
          in: query
          schema:
            type: integer
          description: >-
            Shift response record(s) by the amount specified on this parameter.
            default value = 0
          example: 0
        - name: order_by
          in: query
          schema:
            type: string
          description: 'Order the response record(s) '
          example: id:false
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/access_levels',
              qs: {limit: '50', offset: '0', order_by: 'id:false'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/access_levels");

            req.query({
              "limit": "50",
              "offset": "0",
              "order_by": "id:false"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/access_levels',
              params: {limit: '50', offset: '0', order_by: 'id:false'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/access_levels"


            querystring = {"limit":"50","offset":"0","order_by":"id:false"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/access_levels');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => '50',
              'offset' => '0',
              'order_by' => 'id:false'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/access_levels');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'limit' => '50',
              'offset' => '0',
              'order_by' => 'id:false'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/access_levels"


            queryString <- list(
              limit = "50",
              offset = "0"
              order_by = "id:false",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/access_levels?limit=50&offset=0&order_by=id%3Afalse")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/access_levels/{id}:
    put:
      tags:
        - Access Level
      summary: Update an Access Level
      operationId: updateAccessLevel
      description: |-
        This request is used to update an Access Level (AL)

        **Known errors:**

        - Placing "/" at the end of the endpoint
            
        - `name` is a required and unique parameter
            
        - Duplicate id on doors instance
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                access_level_items:
                  type: array
                  description: Array of access level items linking doors to schedules
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: ID of the access level item (for existing items)
                      doors:
                        type: array
                        description: Array of door objects
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: ID of the door
                      schedule_id:
                        type: object
                        description: Schedule object
                        properties:
                          id:
                            type: integer
                            description: ID of the schedule
              example:
                AccessLevel:
                  name: Test Update
                  description: Update
                  access_level_items:
                    - id: 126
                      doors:
                        - id: 75
                        - id: 80
                      schedule_id:
                        id: 1
                    - id: 128
                      doors:
                        - id: 75
                        - id: 79
                      schedule_id:
                        id: 2
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the AL that will be updated
          example: 41
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/access_levels/41 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"AccessLevel":{"name":"Test Update","description":"Update","access_level_items":[{"id":126,"doors":[{"id":75},{"id":80}],"schedule_id":{"id":1}},{"id":128,"doors":[{"id":75},{"id":79}],"schedule_id":{"id":2}}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"AccessLevel":{"name":"Test
            Update","description":"Update","access_level_items":[{"id":126,"doors":[{"id":75},{"id":80}],"schedule_id":{"id":1}},{"id":128,"doors":[{"id":75},{"id":79}],"schedule_id":{"id":2}}]}}'
            |  \
              http PUT https://{baseurl}/api/access_levels/41 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"AccessLevel":{"name":"Test Update","description":"Update","access_level_items":[{"id":126,"doors":[{"id":75},{"id":80}],"schedule_id":{"id":1}},{"id":128,"doors":[{"id":75},{"id":79}],"schedule_id":{"id":2}}]}}' \
              --output-document \
              - https://{baseurl}/api/access_levels/41
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/access_levels/41",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              AccessLevel: {
                name: 'Test Update',
                description: 'Update',
                access_level_items: [
                  {id: 126, doors: [{id: 75}, {id: 80}], schedule_id: {id: 1}},
                  {id: 128, doors: [{id: 75}, {id: 79}], schedule_id: {id: 2}}
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/access_levels/41',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                AccessLevel: {
                  name: 'Test Update',
                  description: 'Update',
                  access_level_items: [
                    {id: 126, doors: [{id: 75}, {id: 80}], schedule_id: {id: 1}},
                    {id: 128, doors: [{id: 75}, {id: 79}], schedule_id: {id: 2}}
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/access_levels/41");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "AccessLevel": {
                "name": "Test Update",
                "description": "Update",
                "access_level_items": [
                  {
                    "id": 126,
                    "doors": [
                      {
                        "id": 75
                      },
                      {
                        "id": 80
                      }
                    ],
                    "schedule_id": {
                      "id": 1
                    }
                  },
                  {
                    "id": 128,
                    "doors": [
                      {
                        "id": 75
                      },
                      {
                        "id": 79
                      }
                    ],
                    "schedule_id": {
                      "id": 2
                    }
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/access_levels/41',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                AccessLevel: {
                  name: 'Test Update',
                  description: 'Update',
                  access_level_items: [
                    {id: 126, doors: [{id: 75}, {id: 80}], schedule_id: {id: 1}},
                    {id: 128, doors: [{id: 75}, {id: 79}], schedule_id: {id: 2}}
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/access_levels/41';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AccessLevel":{"name":"Test Update","description":"Update","access_level_items":[{"id":126,"doors":[{"id":75},{"id":80}],"schedule_id":{"id":1}},{"id":128,"doors":[{"id":75},{"id":79}],"schedule_id":{"id":2}}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AccessLevel":{"name":"Test Update","description":"Update","access_level_items":[{"id":126,"doors":[{"id":75},{"id":80}],"schedule_id":{"id":1}},{"id":128,"doors":[{"id":75},{"id":79}],"schedule_id":{"id":2}}]}}'
            };

            fetch('https://{baseurl}/api/access_levels/41', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/access_levels/41",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"AccessLevel\":{\"name\":\"Test Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "AccessLevel": {
                "name": "Test Update",
                "description": "Update",
                "access_level_items": [
                  {
                    "id": 126,
                    "doors": [
                      {
                        "id": 75
                      },
                      {
                        "id": 80
                      }
                    ],
                    "schedule_id": {
                      "id": 1
                    }
                  },
                  {
                    "id": 128,
                    "doors": [
                      {
                        "id": 75
                      },
                      {
                        "id": 79
                      }
                    ],
                    "schedule_id": {
                      "id": 2
                    }
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/access_levels/41");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"AccessLevel\":{\"name\":\"Test
            Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/access_levels/41", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/access_levels/41"


            payload = {"AccessLevel": {
                    "name": "Test Update",
                    "description": "Update",
                    "access_level_items": [
                        {
                            "id": 126,
                            "doors": [{"id": 75}, {"id": 80}],
                            "schedule_id": {"id": 1}
                        },
                        {
                            "id": 128,
                            "doors": [{"id": 75}, {"id": 79}],
                            "schedule_id": {"id": 2}
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/access_levels/41")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"AccessLevel\":{\"name\":\"Test
            Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/access_levels/41",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"AccessLevel\":{\"name\":\"Test Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/access_levels/41');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"AccessLevel":{"name":"Test
            Update","description":"Update","access_level_items":[{"id":126,"doors":[{"id":75},{"id":80}],"schedule_id":{"id":1}},{"id":128,"doors":[{"id":75},{"id":79}],"schedule_id":{"id":2}}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"AccessLevel":{"name":"Test
            Update","description":"Update","access_level_items":[{"id":126,"doors":[{"id":75},{"id":80}],"schedule_id":{"id":1}},{"id":128,"doors":[{"id":75},{"id":79}],"schedule_id":{"id":2}}]}}');


            $request->setRequestUrl('https://{baseurl}/api/access_levels/41');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"AccessLevel\":{\"name\":\"Test
            Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/access_levels/41")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/access_levels/41")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"AccessLevel\":{\"name\":\"Test Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/access_levels/41\"\n\n\tpayload := strings.NewReader(\"{\\\"AccessLevel\\\":{\\\"name\\\":\\\"Test Update\\\",\\\"description\\\":\\\"Update\\\",\\\"access_level_items\\\":[{\\\"id\\\":126,\\\"doors\\\":[{\\\"id\\\":75},{\\\"id\\\":80}],\\\"schedule_id\\\":{\\\"id\\\":1}},{\\\"id\\\":128,\\\"doors\\\":[{\\\"id\\\":75},{\\\"id\\\":79}],\\\"schedule_id\\\":{\\\"id\\\":2}}]}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/access_levels/41");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"AccessLevel\":{\"name\":\"Test
            Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"AccessLevel": @{ @"name": @"Test
            Update", @"description": @"Update", @"access_level_items": @[ @{
            @"id": @126, @"doors": @[ @{ @"id": @75 }, @{ @"id": @80 } ],
            @"schedule_id": @{ @"id": @1 } }, @{ @"id": @128, @"doors": @[ @{
            @"id": @75 }, @{ @"id": @79 } ], @"schedule_id": @{ @"id": @2 } } ]
            } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/access_levels/41"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["AccessLevel": [
                "name": "Test Update",
                "description": "Update",
                "access_level_items": [
                  [
                    "id": 126,
                    "doors": [["id": 75], ["id": 80]],
                    "schedule_id": ["id": 1]
                  ],
                  [
                    "id": 128,
                    "doors": [["id": 75], ["id": 79]],
                    "schedule_id": ["id": 2]
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/access_levels/41")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/access_levels/41");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"AccessLevel\":{\"name\":\"Test
            Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/access_levels/41"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"AccessLevel\":{\"name\":\"Test Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/access_levels/41' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"AccessLevel":{"name":"Test
            Update","description":"Update","access_level_items":[{"id":126,"doors":[{"id":75},{"id":80}],"schedule_id":{"id":1}},{"id":128,"doors":[{"id":75},{"id":79}],"schedule_id":{"id":2}}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/access_levels/41' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"AccessLevel":{"name":"Test
            Update","description":"Update","access_level_items":[{"id":126,"doors":[{"id":75},{"id":80}],"schedule_id":{"id":1}},{"id":128,"doors":[{"id":75},{"id":79}],"schedule_id":{"id":2}}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/access_levels/41"


            payload <- "{\"AccessLevel\":{\"name\":\"Test
            Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/access_levels/41" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"AccessLevel\":{\"name\":\"Test
            Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"AccessLevel\":{\"name\":\"Test
            Update\",\"description\":\"Update\",\"access_level_items\":[{\"id\":126,\"doors\":[{\"id\":75},{\"id\":80}],\"schedule_id\":{\"id\":1}},{\"id\":128,\"doors\":[{\"id\":75},{\"id\":79}],\"schedule_id\":{\"id\":2}}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/access_levels/41")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Access Level
      summary: Delete an Access Level
      operationId: deleteAccessLevel
      description: >-
        This request is used to delete an existing Access Level (AL)


        **Known errors:**


        - Placing "/" at the end of the endpoint
            
        - Value other than number on PATH variable
            
        - Non-existent record id on PATH variable will return success but no
        action.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the AL that will be deleted
          example: 12
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url https://{baseurl}/api/access_levels/12 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE https://{baseurl}/api/access_levels/12 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/access_levels/12
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/access_levels/12",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/access_levels/12',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/access_levels/12");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/access_levels/12',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/access_levels/12';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/access_levels/12', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/access_levels/12",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/access_levels/12");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/access_levels/12",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/access_levels/12"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("DELETE", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/access_levels/12")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/access_levels/12",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/access_levels/12');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/access_levels/12');
            $request->setRequestMethod('DELETE');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/access_levels/12")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/access_levels/12")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/access_levels/12\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/access_levels/12");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/access_levels/12"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/access_levels/12")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/access_levels/12");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/access_levels/12"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/access_levels/12' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/access_levels/12' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/access_levels/12"


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/access_levels/12" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/access_levels/12")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/getBackupDbConfig:
    get:
      tags:
        - Backup
      summary: View Backup Configuration
      operationId: getBackupConfig
      description: This API is used to view BioStar X Backup configuration.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/setting/getBackupDbConfig \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/setting/getBackupDbConfig \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/setting/getBackupDbConfig
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/getBackupDbConfig",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/getBackupDbConfig',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/setting/getBackupDbConfig");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/getBackupDbConfig',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/setting/getBackupDbConfig';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/setting/getBackupDbConfig', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/getBackupDbConfig",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/setting/getBackupDbConfig");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/setting/getBackupDbConfig",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/setting/getBackupDbConfig"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/setting/getBackupDbConfig")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/getBackupDbConfig",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/getBackupDbConfig');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/getBackupDbConfig');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/getBackupDbConfig")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/setting/getBackupDbConfig")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/getBackupDbConfig\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/getBackupDbConfig");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/getBackupDbConfig"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/getBackupDbConfig")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/getBackupDbConfig");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/getBackupDbConfig"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/getBackupDbConfig' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/getBackupDbConfig' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/getBackupDbConfig"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/getBackupDbConfig" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/getBackupDbConfig")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/checkBackupScheduler:
    get:
      tags:
        - Backup
      summary: Check Running Schedule
      operationId: getCheckBackupScheduler
      description: >-
        This API is used to check if there's any running backup process.


        Message response will be `True` if there's any, and `False` if there's
        no running backup process.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/setting/checkBackupScheduler \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/setting/checkBackupScheduler \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/setting/checkBackupScheduler
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/checkBackupScheduler",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/checkBackupScheduler',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/setting/checkBackupScheduler");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/checkBackupScheduler',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/setting/checkBackupScheduler';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/setting/checkBackupScheduler',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/checkBackupScheduler",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/setting/checkBackupScheduler");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/setting/checkBackupScheduler",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/setting/checkBackupScheduler"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/setting/checkBackupScheduler")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/checkBackupScheduler",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/checkBackupScheduler');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/checkBackupScheduler');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/checkBackupScheduler")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/setting/checkBackupScheduler")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/checkBackupScheduler\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/checkBackupScheduler");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/checkBackupScheduler"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/checkBackupScheduler")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/checkBackupScheduler");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/checkBackupScheduler"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/checkBackupScheduler' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/checkBackupScheduler' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/checkBackupScheduler"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/checkBackupScheduler" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/checkBackupScheduler")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/modifyBackupDbConfig:
    post:
      tags:
        - Backup
      summary: Update Backup Configuration
      operationId: updateBackupConfig
      description: This API is used to modify BioStar X backup configuration.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - use
                - cycle
                - path
                - minute
                - hour
                - days
                - month
                - weeks
                - userId
              properties:
                use:
                  type: string
                  enum:
                    - 'true'
                    - 'false'
                  description: Toggle to enable/disable scheduled backup
                cycle:
                  type: string
                  pattern: ^([1-9]|[1-9][0-9]|100)$
                  description: Number of backup files to keep (1 to 100)
                path:
                  type: string
                  description: Backup folder path (must exist)
                  example: C:\Backup
                minute:
                  type: string
                  pattern: ^([0-9]|[1-5][0-9])$
                  description: Minute value for scheduled backup (0 to 59)
                hour:
                  type: string
                  pattern: ^([0-9]|1[0-9]|2[0-3])$
                  description: Hour value for scheduled backup (0 to 23)
                days:
                  type: string
                  description: Date value for scheduled backup
                month:
                  type: string
                  description: >-
                    Month value for Scheduled Backup. Leave it as \* since
                    currently it only support Daily and Weekly.
                weeks:
                  type: string
                  description: >-
                    Day value for Scheduled Backup. Used when it's configured as
                    Weekly Backup. (mon tue wed thu fri sat sun, default value
                    is ?)
                userId:
                  type: string
                  description: User ID of the user who modifies the configuration
            example:
              use: 'true'
              cycle: '10'
              path: C:\\Backup
              minute: '12'
              hour: '0'
              days: '*'
              month: '*'
              weeks: '?'
              userId: '1'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/setting/modifyBackupDbConfig \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"use":"true","cycle":"string","path":"C:\\Backup","minute":"string","hour":"string","days":"string","month":"string","weeks":"string","userId":"string"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"use":"true","cycle":"string","path":"C:\\Backup","minute":"string","hour":"string","days":"string","month":"string","weeks":"string","userId":"string"}'
            |  \
              http POST https://{baseurl}/api/v2/setting/modifyBackupDbConfig \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"use":"true","cycle":"string","path":"C:\\Backup","minute":"string","hour":"string","days":"string","month":"string","weeks":"string","userId":"string"}' \
              --output-document \
              - https://{baseurl}/api/v2/setting/modifyBackupDbConfig
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/modifyBackupDbConfig",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              use: 'true',
              cycle: 'string',
              path: 'C:\Backup',
              minute: 'string',
              hour: 'string',
              days: 'string',
              month: 'string',
              weeks: 'string',
              userId: 'string'
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/modifyBackupDbConfig',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                use: 'true',
                cycle: 'string',
                path: 'C:\Backup',
                minute: 'string',
                hour: 'string',
                days: 'string',
                month: 'string',
                weeks: 'string',
                userId: 'string'
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/setting/modifyBackupDbConfig");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "use": "true",
              "cycle": "string",
              "path": "C:\\Backup",
              "minute": "string",
              "hour": "string",
              "days": "string",
              "month": "string",
              "weeks": "string",
              "userId": "string"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/modifyBackupDbConfig',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                use: 'true',
                cycle: 'string',
                path: 'C:\Backup',
                minute: 'string',
                hour: 'string',
                days: 'string',
                month: 'string',
                weeks: 'string',
                userId: 'string'
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/setting/modifyBackupDbConfig';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"use":"true","cycle":"string","path":"C:\\Backup","minute":"string","hour":"string","days":"string","month":"string","weeks":"string","userId":"string"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"use":"true","cycle":"string","path":"C:\\Backup","minute":"string","hour":"string","days":"string","month":"string","weeks":"string","userId":"string"}'
            };


            fetch('https://{baseurl}/api/v2/setting/modifyBackupDbConfig',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/modifyBackupDbConfig",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "use": "true",
              "cycle": "string",
              "path": "C:\\Backup",
              "minute": "string",
              "hour": "string",
              "days": "string",
              "month": "string",
              "weeks": "string",
              "userId": "string"
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/v2/setting/modifyBackupDbConfig");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/v2/setting/modifyBackupDbConfig", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/setting/modifyBackupDbConfig"


            payload = {
                "use": "true",
                "cycle": "string",
                "path": "C:\Backup",
                "minute": "string",
                "hour": "string",
                "days": "string",
                "month": "string",
                "weeks": "string",
                "userId": "string"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/setting/modifyBackupDbConfig")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/modifyBackupDbConfig",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/modifyBackupDbConfig');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"use":"true","cycle":"string","path":"C:\\\\Backup","minute":"string","hour":"string","days":"string","month":"string","weeks":"string","userId":"string"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"use":"true","cycle":"string","path":"C:\\\\Backup","minute":"string","hour":"string","days":"string","month":"string","weeks":"string","userId":"string"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/modifyBackupDbConfig');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/modifyBackupDbConfig")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/setting/modifyBackupDbConfig")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/modifyBackupDbConfig\"\n\n\tpayload := strings.NewReader(\"{\\\"use\\\":\\\"true\\\",\\\"cycle\\\":\\\"string\\\",\\\"path\\\":\\\"C:\\\\\\\\Backup\\\",\\\"minute\\\":\\\"string\\\",\\\"hour\\\":\\\"string\\\",\\\"days\\\":\\\"string\\\",\\\"month\\\":\\\"string\\\",\\\"weeks\\\":\\\"string\\\",\\\"userId\\\":\\\"string\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/modifyBackupDbConfig");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"use": @"true",
                                          @"cycle": @"string",
                                          @"path": @"C:\Backup",
                                          @"minute": @"string",
                                          @"hour": @"string",
                                          @"days": @"string",
                                          @"month": @"string",
                                          @"weeks": @"string",
                                          @"userId": @"string" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/modifyBackupDbConfig"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "use": "true",
              "cycle": "string",
              "path": "C:\Backup",
              "minute": "string",
              "hour": "string",
              "days": "string",
              "month": "string",
              "weeks": "string",
              "userId": "string"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/modifyBackupDbConfig")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/modifyBackupDbConfig");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/modifyBackupDbConfig"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/modifyBackupDbConfig' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"use":"true","cycle":"string","path":"C:\\Backup","minute":"string","hour":"string","days":"string","month":"string","weeks":"string","userId":"string"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/modifyBackupDbConfig' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"use":"true","cycle":"string","path":"C:\\Backup","minute":"string","hour":"string","days":"string","month":"string","weeks":"string","userId":"string"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/modifyBackupDbConfig"


            payload <-
            "{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/modifyBackupDbConfig" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"use\":\"true\",\"cycle\":\"string\",\"path\":\"C:\\\\Backup\",\"minute\":\"string\",\"hour\":\"string\",\"days\":\"string\",\"month\":\"string\",\"weeks\":\"string\",\"userId\":\"string\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/modifyBackupDbConfig")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/backupNow:
    post:
      tags:
        - Backup
      summary: Run Backup
      operationId: createBackupNow
      description: >-
        This API is used to run Backup process.


        It is required to have BODY parameters when running this API. Use `GET
        /api/v2/setting/getBackupDbConfig` for BODY payload.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                use:
                  type: string
                  enum:
                    - 'true'
                    - 'false'
                  description: Toggle to enable/disable scheduled backup
                cycle:
                  type: string
                  pattern: ^([1-9]|[1-9][0-9]|100)$
                  description: Number of backup files to keep (1 to 100)
                path:
                  type: string
                  description: Backup folder path (must exist)
                  example: C:\Backup
                minute:
                  type: string
                  pattern: ^([0-9]|[1-5][0-9])$
                  description: Minute value for scheduled backup (0 to 59)
                hour:
                  type: string
                  pattern: ^([0-9]|1[0-9]|2[0-3])$
                  description: Hour value for scheduled backup (0 to 23)
                days:
                  type: string
                  description: Date value for scheduled backup
                month:
                  type: string
                  description: >-
                    Month value for Scheduled Backup. Leave it as \* since
                    currently it only support Daily and Weekly.
                weeks:
                  type: string
                  description: >-
                    Day value for Scheduled Backup. Used when it's configured as
                    Weekly Backup. (mon tue wed thu fri sat sun, default value
                    is ?)
              example:
                use: 'false'
                cycle: '5'
                path: C:\Program Files\BioStar 2(x64)\Backup
                minute: '0'
                hour: '0'
                days: '*'
                month: '*'
                weeks: '*'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/setting/backupNow \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"use":"false","cycle":"5","path":"C:\\Program Files\\BioStar 2(x64)\\Backup","minute":"0","hour":"0","days":"*","month":"*","weeks":"*"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"use":"false","cycle":"5","path":"C:\\Program Files\\BioStar
            2(x64)\\Backup","minute":"0","hour":"0","days":"*","month":"*","weeks":"*"}'
            |  \
              http POST https://{baseurl}/api/v2/setting/backupNow \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"use":"false","cycle":"5","path":"C:\\Program Files\\BioStar 2(x64)\\Backup","minute":"0","hour":"0","days":"*","month":"*","weeks":"*"}' \
              --output-document \
              - https://{baseurl}/api/v2/setting/backupNow
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/backupNow",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              use: 'false',
              cycle: '5',
              path: 'C:\Program Files\BioStar 2(x64)\Backup',
              minute: '0',
              hour: '0',
              days: '*',
              month: '*',
              weeks: '*'
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/backupNow',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                use: 'false',
                cycle: '5',
                path: 'C:\Program Files\BioStar 2(x64)\Backup',
                minute: '0',
                hour: '0',
                days: '*',
                month: '*',
                weeks: '*'
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/setting/backupNow");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "use": "false",
              "cycle": "5",
              "path": "C:\\Program Files\\BioStar 2(x64)\\Backup",
              "minute": "0",
              "hour": "0",
              "days": "*",
              "month": "*",
              "weeks": "*"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/backupNow',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                use: 'false',
                cycle: '5',
                path: 'C:\Program Files\BioStar 2(x64)\Backup',
                minute: '0',
                hour: '0',
                days: '*',
                month: '*',
                weeks: '*'
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/setting/backupNow';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"use":"false","cycle":"5","path":"C:\\Program Files\\BioStar 2(x64)\\Backup","minute":"0","hour":"0","days":"*","month":"*","weeks":"*"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"use":"false","cycle":"5","path":"C:\\Program Files\\BioStar 2(x64)\\Backup","minute":"0","hour":"0","days":"*","month":"*","weeks":"*"}'
            };

            fetch('https://{baseurl}/api/v2/setting/backupNow', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/backupNow",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program Files\\\\BioStar 2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "use": "false",
              "cycle": "5",
              "path": "C:\\Program Files\\BioStar 2(x64)\\Backup",
              "minute": "0",
              "hour": "0",
              "days": "*",
              "month": "*",
              "weeks": "*"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/setting/backupNow");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/setting/backupNow", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/setting/backupNow"


            payload = {
                "use": "false",
                "cycle": "5",
                "path": "C:\Program Files\BioStar 2(x64)\Backup",
                "minute": "0",
                "hour": "0",
                "days": "*",
                "month": "*",
                "weeks": "*"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/setting/backupNow")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/backupNow",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program Files\\\\BioStar 2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/backupNow');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"use":"false","cycle":"5","path":"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\Backup","minute":"0","hour":"0","days":"*","month":"*","weeks":"*"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"use":"false","cycle":"5","path":"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\Backup","minute":"0","hour":"0","days":"*","month":"*","weeks":"*"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/backupNow');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/backupNow")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/setting/backupNow")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program Files\\\\BioStar 2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/backupNow\"\n\n\tpayload := strings.NewReader(\"{\\\"use\\\":\\\"false\\\",\\\"cycle\\\":\\\"5\\\",\\\"path\\\":\\\"C:\\\\\\\\Program Files\\\\\\\\BioStar 2(x64)\\\\\\\\Backup\\\",\\\"minute\\\":\\\"0\\\",\\\"hour\\\":\\\"0\\\",\\\"days\\\":\\\"*\\\",\\\"month\\\":\\\"*\\\",\\\"weeks\\\":\\\"*\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/backupNow");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"use": @"false",
                                          @"cycle": @"5",
                                          @"path": @"C:\Program Files\BioStar 2(x64)\Backup",
                                          @"minute": @"0",
                                          @"hour": @"0",
                                          @"days": @"*",
                                          @"month": @"*",
                                          @"weeks": @"*" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/backupNow"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "use": "false",
              "cycle": "5",
              "path": "C:\Program Files\BioStar 2(x64)\Backup",
              "minute": "0",
              "hour": "0",
              "days": "*",
              "month": "*",
              "weeks": "*"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/backupNow")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/backupNow");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/backupNow"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program Files\\\\BioStar 2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/backupNow' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"use":"false","cycle":"5","path":"C:\\Program Files\\BioStar
            2(x64)\\Backup","minute":"0","hour":"0","days":"*","month":"*","weeks":"*"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/backupNow' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"use":"false","cycle":"5","path":"C:\\Program Files\\BioStar
            2(x64)\\Backup","minute":"0","hour":"0","days":"*","month":"*","weeks":"*"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/backupNow"


            payload <-
            "{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/setting/backupNow"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"use\":\"false\",\"cycle\":\"5\",\"path\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\Backup\",\"minute\":\"0\",\"hour\":\"0\",\"days\":\"*\",\"month\":\"*\",\"weeks\":\"*\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/backupNow")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/cards/wiegand_formats/{id}:
    put:
      tags:
        - Cards
      summary: Update Wiegand Formats
      operationId: updateWiegandFormat
      description: >-
        It is possible to use a custom wiegand format.

        To create a custom format, you can edit the provided formats which is
        between id number 5 to 14.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WiegandFormatInput'
      parameters:
        - name: id
          in: path
          schema:
            type: integer
            minimum: 5
            maximum: 14
          required: true
          description: >-
            ID of the wiegand format which will be updated (5-14 for custom
            formats).
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/cards/wiegand_formats/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"WiegandFormat":{"id":"5","name":"Custom Format","description":"Custom Wiegand format description","length":32,"use_facility_code":true,"id_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="],"parity_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="],"parity_types":[1,2],"parity_positions":[0,31]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"WiegandFormat":{"id":"5","name":"Custom
            Format","description":"Custom Wiegand format
            description","length":32,"use_facility_code":true,"id_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="],"parity_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="],"parity_types":[1,2],"parity_positions":[0,31]}}'
            |  \
              http PUT https://{baseurl}/api/cards/wiegand_formats/{id} \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"WiegandFormat":{"id":"5","name":"Custom Format","description":"Custom Wiegand format description","length":32,"use_facility_code":true,"id_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="],"parity_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="],"parity_types":[1,2],"parity_positions":[0,31]}}' \
              --output-document \
              - https://{baseurl}/api/cards/wiegand_formats/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/wiegand_formats/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              WiegandFormat: {
                id: '5',
                name: 'Custom Format',
                description: 'Custom Wiegand format description',
                length: 32,
                use_facility_code: true,
                id_fields: [
                  'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=',
                  'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4='
                ],
                parity_fields: [
                  'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=',
                  'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE='
                ],
                parity_types: [1, 2],
                parity_positions: [0, 31]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/cards/wiegand_formats/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                WiegandFormat: {
                  id: '5',
                  name: 'Custom Format',
                  description: 'Custom Wiegand format description',
                  length: 32,
                  use_facility_code: true,
                  id_fields: [
                    'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=',
                    'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4='
                  ],
                  parity_fields: [
                    'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=',
                    'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE='
                  ],
                  parity_types: [1, 2],
                  parity_positions: [0, 31]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/cards/wiegand_formats/{id}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "WiegandFormat": {
                "id": "5",
                "name": "Custom Format",
                "description": "Custom Wiegand format description",
                "length": 32,
                "use_facility_code": true,
                "id_fields": [
                  "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=",
                  "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="
                ],
                "parity_fields": [
                  "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=",
                  "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="
                ],
                "parity_types": [
                  1,
                  2
                ],
                "parity_positions": [
                  0,
                  31
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/cards/wiegand_formats/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                WiegandFormat: {
                  id: '5',
                  name: 'Custom Format',
                  description: 'Custom Wiegand format description',
                  length: 32,
                  use_facility_code: true,
                  id_fields: [
                    'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=',
                    'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4='
                  ],
                  parity_fields: [
                    'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=',
                    'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE='
                  ],
                  parity_types: [1, 2],
                  parity_positions: [0, 31]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/cards/wiegand_formats/{id}';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"WiegandFormat":{"id":"5","name":"Custom Format","description":"Custom Wiegand format description","length":32,"use_facility_code":true,"id_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="],"parity_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="],"parity_types":[1,2],"parity_positions":[0,31]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"WiegandFormat":{"id":"5","name":"Custom Format","description":"Custom Wiegand format description","length":32,"use_facility_code":true,"id_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="],"parity_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="],"parity_types":[1,2],"parity_positions":[0,31]}}'
            };

            fetch('https://{baseurl}/api/cards/wiegand_formats/{id}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/wiegand_formats/{id}",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom Format\",\"description\":\"Custom Wiegand format description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "WiegandFormat": {
                "id": "5",
                "name": "Custom Format",
                "description": "Custom Wiegand format description",
                "length": 32,
                "use_facility_code": true,
                "id_fields": [
                  "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=",
                  "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="
                ],
                "parity_fields": [
                  "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=",
                  "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="
                ],
                "parity_types": [
                  1,
                  2
                ],
                "parity_positions": [
                  0,
                  31
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/cards/wiegand_formats/{id}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom
            Format\",\"description\":\"Custom Wiegand format
            description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/cards/wiegand_formats/{id}",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards/wiegand_formats/{id}"


            payload = {"WiegandFormat": {
                    "id": "5",
                    "name": "Custom Format",
                    "description": "Custom Wiegand format description",
                    "length": 32,
                    "use_facility_code": True,
                    "id_fields": ["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="],
                    "parity_fields": ["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="],
                    "parity_types": [1, 2],
                    "parity_positions": [0, 31]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/cards/wiegand_formats/{id}")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom
            Format\",\"description\":\"Custom Wiegand format
            description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/wiegand_formats/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom Format\",\"description\":\"Custom Wiegand format description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/cards/wiegand_formats/{id}');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"WiegandFormat":{"id":"5","name":"Custom
            Format","description":"Custom Wiegand format
            description","length":32,"use_facility_code":true,"id_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="],"parity_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="],"parity_types":[1,2],"parity_positions":[0,31]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"WiegandFormat":{"id":"5","name":"Custom
            Format","description":"Custom Wiegand format
            description","length":32,"use_facility_code":true,"id_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="],"parity_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="],"parity_types":[1,2],"parity_positions":[0,31]}}');


            $request->setRequestUrl('https://{baseurl}/api/cards/wiegand_formats/{id}');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom
            Format\",\"description\":\"Custom Wiegand format
            description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/wiegand_formats/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/cards/wiegand_formats/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom Format\",\"description\":\"Custom Wiegand format description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/wiegand_formats/{id}\"\n\n\tpayload := strings.NewReader(\"{\\\"WiegandFormat\\\":{\\\"id\\\":\\\"5\\\",\\\"name\\\":\\\"Custom Format\\\",\\\"description\\\":\\\"Custom Wiegand format description\\\",\\\"length\\\":32,\\\"use_facility_code\\\":true,\\\"id_fields\\\":[\\\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\\\",\\\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\\\"],\\\"parity_fields\\\":[\\\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\\\",\\\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\\\"],\\\"parity_types\\\":[1,2],\\\"parity_positions\\\":[0,31]}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/wiegand_formats/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom
            Format\",\"description\":\"Custom Wiegand format
            description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"WiegandFormat": @{ @"id": @"5",
            @"name": @"Custom Format", @"description": @"Custom Wiegand format
            description", @"length": @32, @"use_facility_code": @YES,
            @"id_fields": @[ @"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=",
            @"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=" ], @"parity_fields":
            @[ @"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=",
            @"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=" ], @"parity_types":
            @[ @1, @2 ], @"parity_positions": @[ @0, @31 ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/wiegand_formats/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["WiegandFormat": [
                "id": "5",
                "name": "Custom Format",
                "description": "Custom Wiegand format description",
                "length": 32,
                "use_facility_code": true,
                "id_fields": ["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="],
                "parity_fields": ["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="],
                "parity_types": [1, 2],
                "parity_positions": [0, 31]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/wiegand_formats/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/wiegand_formats/{id}");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom
            Format\",\"description\":\"Custom Wiegand format
            description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/cards/wiegand_formats/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom Format\",\"description\":\"Custom Wiegand format description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/wiegand_formats/{id}' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"WiegandFormat":{"id":"5","name":"Custom
            Format","description":"Custom Wiegand format
            description","length":32,"use_facility_code":true,"id_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="],"parity_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="],"parity_types":[1,2],"parity_positions":[0,31]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/wiegand_formats/{id}' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"WiegandFormat":{"id":"5","name":"Custom
            Format","description":"Custom Wiegand format
            description","length":32,"use_facility_code":true,"id_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4="],"parity_fields":["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=","AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE="],"parity_types":[1,2],"parity_positions":[0,31]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/wiegand_formats/{id}"


            payload <- "{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom
            Format\",\"description\":\"Custom Wiegand format
            description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/cards/wiegand_formats/{id}" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom
            Format\",\"description\":\"Custom Wiegand format
            description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"WiegandFormat\":{\"id\":\"5\",\"name\":\"Custom
            Format\",\"description\":\"Custom Wiegand format
            description\",\"length\":32,\"use_facility_code\":true,\"id_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=\"],\"parity_fields\":[\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=\",\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=\"],\"parity_types\":[1,2],\"parity_positions\":[0,31]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/wiegand_formats/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Cards
      summary: View Wiegand Format Detail
      operationId: getWiegandFormat
      description: This API is used to view a wiegand format detail.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/cards/wiegand_formats/1 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/cards/wiegand_formats/1 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/cards/wiegand_formats/1
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/wiegand_formats/1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/wiegand_formats/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/cards/wiegand_formats/1");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/wiegand_formats/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/cards/wiegand_formats/1';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/cards/wiegand_formats/1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/wiegand_formats/1",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/cards/wiegand_formats/1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/cards/wiegand_formats/1",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/cards/wiegand_formats/1"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/cards/wiegand_formats/1")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/wiegand_formats/1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards/wiegand_formats/1');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/cards/wiegand_formats/1');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/wiegand_formats/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/cards/wiegand_formats/1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/wiegand_formats/1\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/wiegand_formats/1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/wiegand_formats/1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/wiegand_formats/1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/wiegand_formats/1");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/cards/wiegand_formats/1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/wiegand_formats/1' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/wiegand_formats/1' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/wiegand_formats/1"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/cards/wiegand_formats/1" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/wiegand_formats/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/cards/layouts:
    delete:
      tags:
        - Cards
      summary: Delete Smart Card Layout
      operationId: deleteCardLayout
      description: This API is used to delete smart card layout from BioStar X.
      parameters:
        - name: id
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http DELETE
            'https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/cards/layouts',
              qs: {id: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/cards/layouts");


            req.query({
              "id": "SOME_STRING_VALUE"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/cards/layouts',
              params: {id: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("DELETE",
            "https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE",
            "{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE", headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards/layouts"


            querystring = {"id":"SOME_STRING_VALUE"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Delete.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards/layouts');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/cards/layouts');
            $request->setRequestMethod('DELETE');
            $request->setQuery(new http\QueryString([
              'id' => 'SOME_STRING_VALUE'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE' -Method
            DELETE -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE' -Method
            DELETE -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/layouts"


            queryString <- list([ 'id' ] = "SOME_STRING_VALUE")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/layouts?id=SOME_STRING_VALUE")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Cards
      summary: View Smart Cards Layout
      operationId: getCardLayouts
      description: This API is used to view all available smart card layouts.
      parameters:
        - name: limit
          in: query
          schema:
            type: string
          description: >-
            Limit the number of responses by n records. Remove this parameter to
            view all.
          example: 'null'
        - name: offset
          in: query
          schema:
            type: string
          description: Offset the response shown by n records.
          example: 'null'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/cards/layouts?limit=null&offset=null' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/cards/layouts?limit=null&offset=null' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/cards/layouts?limit=null&offset=null'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/layouts?limit=null&offset=null",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/layouts',
              qs: {limit: 'null', offset: 'null'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/cards/layouts");

            req.query({
              "limit": "null",
              "offset": "null"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/layouts',
              params: {limit: 'null', offset: 'null'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/cards/layouts?limit=null&offset=null';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/cards/layouts?limit=null&offset=null',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/layouts?limit=null&offset=null",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/cards/layouts?limit=null&offset=null");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/cards/layouts?limit=null&offset=null",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards/layouts"


            querystring = {"limit":"null","offset":"null"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/cards/layouts?limit=null&offset=null")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/layouts?limit=null&offset=null",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards/layouts');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => 'null',
              'offset' => 'null'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/cards/layouts');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'limit' => 'null',
              'offset' => 'null'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/layouts?limit=null&offset=null")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/cards/layouts?limit=null&offset=null")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/layouts?limit=null&offset=null\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/layouts?limit=null&offset=null");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/layouts?limit=null&offset=null"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/layouts?limit=null&offset=null")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/layouts?limit=null&offset=null");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/cards/layouts?limit=null&offset=null"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/layouts?limit=null&offset=null' -Method
            GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/layouts?limit=null&offset=null' -Method
            GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/layouts"


            queryString <- list(
              limit = "null"
              offset = "null",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/cards/layouts?limit=null&offset=null" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/layouts?limit=null&offset=null")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Cards
      summary: Create Smart Card Layout
      operationId: createCardLayout
      description: >-
        This API is used to create smart card layout.


        Fill the corresponding parameter with the card's specification.


        If the card uses default configuration, then simply fill the name and
        run the API.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                CardLayout:
                  name: smart_test
                  use_second_key: false
                  number_of_template: 2
                  template_size: 300
                  mifare_primary_key: ''
                  mifare_start_block_index: 4
                  mifare_second_key: ''
                  iclass_primary_key: ''
                  iclass_second_key: ''
                  iclass_start_block_index: 13
                  desfire_primary_key: ''
                  desfire_second_key: ''
                  desfire_app_id: 1
                  desfire_file_id: 1
                  desfire_encryption_type: 0
                  desfire_advanced_mode: 0
                  des_adv_app_master_key_index: 0
                  des_adv_file_read_access_key_index: 1
                  des_adv_file_write_access_key_index: 2
                  seos_primary_key: ''
                  seos_second_key: ''
                  seos_adf: 2A8570811E1000070000020000
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/cards/layouts \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"CardLayout":{"name":"smart_test","use_second_key":false,"number_of_template":2,"template_size":300,"mifare_primary_key":"","mifare_start_block_index":4,"mifare_second_key":"","iclass_primary_key":"","iclass_second_key":"","iclass_start_block_index":13,"desfire_primary_key":"","desfire_second_key":"","desfire_app_id":1,"desfire_file_id":1,"desfire_encryption_type":0,"desfire_advanced_mode":0,"des_adv_app_master_key_index":0,"des_adv_file_read_access_key_index":1,"des_adv_file_write_access_key_index":2,"seos_primary_key":"","seos_second_key":"","seos_adf":"2A8570811E1000070000020000"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"CardLayout":{"name":"smart_test","use_second_key":false,"number_of_template":2,"template_size":300,"mifare_primary_key":"","mifare_start_block_index":4,"mifare_second_key":"","iclass_primary_key":"","iclass_second_key":"","iclass_start_block_index":13,"desfire_primary_key":"","desfire_second_key":"","desfire_app_id":1,"desfire_file_id":1,"desfire_encryption_type":0,"desfire_advanced_mode":0,"des_adv_app_master_key_index":0,"des_adv_file_read_access_key_index":1,"des_adv_file_write_access_key_index":2,"seos_primary_key":"","seos_second_key":"","seos_adf":"2A8570811E1000070000020000"}}'
            |  \
              http POST https://{baseurl}/api/cards/layouts \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"CardLayout":{"name":"smart_test","use_second_key":false,"number_of_template":2,"template_size":300,"mifare_primary_key":"","mifare_start_block_index":4,"mifare_second_key":"","iclass_primary_key":"","iclass_second_key":"","iclass_start_block_index":13,"desfire_primary_key":"","desfire_second_key":"","desfire_app_id":1,"desfire_file_id":1,"desfire_encryption_type":0,"desfire_advanced_mode":0,"des_adv_app_master_key_index":0,"des_adv_file_read_access_key_index":1,"des_adv_file_write_access_key_index":2,"seos_primary_key":"","seos_second_key":"","seos_adf":"2A8570811E1000070000020000"}}' \
              --output-document \
              - https://{baseurl}/api/cards/layouts
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/layouts",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              CardLayout: {
                name: 'smart_test',
                use_second_key: false,
                number_of_template: 2,
                template_size: 300,
                mifare_primary_key: '',
                mifare_start_block_index: 4,
                mifare_second_key: '',
                iclass_primary_key: '',
                iclass_second_key: '',
                iclass_start_block_index: 13,
                desfire_primary_key: '',
                desfire_second_key: '',
                desfire_app_id: 1,
                desfire_file_id: 1,
                desfire_encryption_type: 0,
                desfire_advanced_mode: 0,
                des_adv_app_master_key_index: 0,
                des_adv_file_read_access_key_index: 1,
                des_adv_file_write_access_key_index: 2,
                seos_primary_key: '',
                seos_second_key: '',
                seos_adf: '2A8570811E1000070000020000'
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/cards/layouts',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                CardLayout: {
                  name: 'smart_test',
                  use_second_key: false,
                  number_of_template: 2,
                  template_size: 300,
                  mifare_primary_key: '',
                  mifare_start_block_index: 4,
                  mifare_second_key: '',
                  iclass_primary_key: '',
                  iclass_second_key: '',
                  iclass_start_block_index: 13,
                  desfire_primary_key: '',
                  desfire_second_key: '',
                  desfire_app_id: 1,
                  desfire_file_id: 1,
                  desfire_encryption_type: 0,
                  desfire_advanced_mode: 0,
                  des_adv_app_master_key_index: 0,
                  des_adv_file_read_access_key_index: 1,
                  des_adv_file_write_access_key_index: 2,
                  seos_primary_key: '',
                  seos_second_key: '',
                  seos_adf: '2A8570811E1000070000020000'
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/cards/layouts");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "CardLayout": {
                "name": "smart_test",
                "use_second_key": false,
                "number_of_template": 2,
                "template_size": 300,
                "mifare_primary_key": "",
                "mifare_start_block_index": 4,
                "mifare_second_key": "",
                "iclass_primary_key": "",
                "iclass_second_key": "",
                "iclass_start_block_index": 13,
                "desfire_primary_key": "",
                "desfire_second_key": "",
                "desfire_app_id": 1,
                "desfire_file_id": 1,
                "desfire_encryption_type": 0,
                "desfire_advanced_mode": 0,
                "des_adv_app_master_key_index": 0,
                "des_adv_file_read_access_key_index": 1,
                "des_adv_file_write_access_key_index": 2,
                "seos_primary_key": "",
                "seos_second_key": "",
                "seos_adf": "2A8570811E1000070000020000"
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/cards/layouts',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                CardLayout: {
                  name: 'smart_test',
                  use_second_key: false,
                  number_of_template: 2,
                  template_size: 300,
                  mifare_primary_key: '',
                  mifare_start_block_index: 4,
                  mifare_second_key: '',
                  iclass_primary_key: '',
                  iclass_second_key: '',
                  iclass_start_block_index: 13,
                  desfire_primary_key: '',
                  desfire_second_key: '',
                  desfire_app_id: 1,
                  desfire_file_id: 1,
                  desfire_encryption_type: 0,
                  desfire_advanced_mode: 0,
                  des_adv_app_master_key_index: 0,
                  des_adv_file_read_access_key_index: 1,
                  des_adv_file_write_access_key_index: 2,
                  seos_primary_key: '',
                  seos_second_key: '',
                  seos_adf: '2A8570811E1000070000020000'
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/cards/layouts';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"CardLayout":{"name":"smart_test","use_second_key":false,"number_of_template":2,"template_size":300,"mifare_primary_key":"","mifare_start_block_index":4,"mifare_second_key":"","iclass_primary_key":"","iclass_second_key":"","iclass_start_block_index":13,"desfire_primary_key":"","desfire_second_key":"","desfire_app_id":1,"desfire_file_id":1,"desfire_encryption_type":0,"desfire_advanced_mode":0,"des_adv_app_master_key_index":0,"des_adv_file_read_access_key_index":1,"des_adv_file_write_access_key_index":2,"seos_primary_key":"","seos_second_key":"","seos_adf":"2A8570811E1000070000020000"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"CardLayout":{"name":"smart_test","use_second_key":false,"number_of_template":2,"template_size":300,"mifare_primary_key":"","mifare_start_block_index":4,"mifare_second_key":"","iclass_primary_key":"","iclass_second_key":"","iclass_start_block_index":13,"desfire_primary_key":"","desfire_second_key":"","desfire_app_id":1,"desfire_file_id":1,"desfire_encryption_type":0,"desfire_advanced_mode":0,"des_adv_app_master_key_index":0,"des_adv_file_read_access_key_index":1,"des_adv_file_write_access_key_index":2,"seos_primary_key":"","seos_second_key":"","seos_adf":"2A8570811E1000070000020000"}}'
            };

            fetch('https://{baseurl}/api/cards/layouts', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/layouts",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "CardLayout": {
                "name": "smart_test",
                "use_second_key": false,
                "number_of_template": 2,
                "template_size": 300,
                "mifare_primary_key": "",
                "mifare_start_block_index": 4,
                "mifare_second_key": "",
                "iclass_primary_key": "",
                "iclass_second_key": "",
                "iclass_start_block_index": 13,
                "desfire_primary_key": "",
                "desfire_second_key": "",
                "desfire_app_id": 1,
                "desfire_file_id": 1,
                "desfire_encryption_type": 0,
                "desfire_advanced_mode": 0,
                "des_adv_app_master_key_index": 0,
                "des_adv_file_read_access_key_index": 1,
                "des_adv_file_write_access_key_index": 2,
                "seos_primary_key": "",
                "seos_second_key": "",
                "seos_adf": "2A8570811E1000070000020000"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/cards/layouts");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/cards/layouts", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards/layouts"


            payload = {"CardLayout": {
                    "name": "smart_test",
                    "use_second_key": False,
                    "number_of_template": 2,
                    "template_size": 300,
                    "mifare_primary_key": "",
                    "mifare_start_block_index": 4,
                    "mifare_second_key": "",
                    "iclass_primary_key": "",
                    "iclass_second_key": "",
                    "iclass_start_block_index": 13,
                    "desfire_primary_key": "",
                    "desfire_second_key": "",
                    "desfire_app_id": 1,
                    "desfire_file_id": 1,
                    "desfire_encryption_type": 0,
                    "desfire_advanced_mode": 0,
                    "des_adv_app_master_key_index": 0,
                    "des_adv_file_read_access_key_index": 1,
                    "des_adv_file_write_access_key_index": 2,
                    "seos_primary_key": "",
                    "seos_second_key": "",
                    "seos_adf": "2A8570811E1000070000020000"
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/cards/layouts")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/layouts",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/cards/layouts');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"CardLayout":{"name":"smart_test","use_second_key":false,"number_of_template":2,"template_size":300,"mifare_primary_key":"","mifare_start_block_index":4,"mifare_second_key":"","iclass_primary_key":"","iclass_second_key":"","iclass_start_block_index":13,"desfire_primary_key":"","desfire_second_key":"","desfire_app_id":1,"desfire_file_id":1,"desfire_encryption_type":0,"desfire_advanced_mode":0,"des_adv_app_master_key_index":0,"des_adv_file_read_access_key_index":1,"des_adv_file_write_access_key_index":2,"seos_primary_key":"","seos_second_key":"","seos_adf":"2A8570811E1000070000020000"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"CardLayout":{"name":"smart_test","use_second_key":false,"number_of_template":2,"template_size":300,"mifare_primary_key":"","mifare_start_block_index":4,"mifare_second_key":"","iclass_primary_key":"","iclass_second_key":"","iclass_start_block_index":13,"desfire_primary_key":"","desfire_second_key":"","desfire_app_id":1,"desfire_file_id":1,"desfire_encryption_type":0,"desfire_advanced_mode":0,"des_adv_app_master_key_index":0,"des_adv_file_read_access_key_index":1,"des_adv_file_write_access_key_index":2,"seos_primary_key":"","seos_second_key":"","seos_adf":"2A8570811E1000070000020000"}}');


            $request->setRequestUrl('https://{baseurl}/api/cards/layouts');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/layouts")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/cards/layouts")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/layouts\"\n\n\tpayload := strings.NewReader(\"{\\\"CardLayout\\\":{\\\"name\\\":\\\"smart_test\\\",\\\"use_second_key\\\":false,\\\"number_of_template\\\":2,\\\"template_size\\\":300,\\\"mifare_primary_key\\\":\\\"\\\",\\\"mifare_start_block_index\\\":4,\\\"mifare_second_key\\\":\\\"\\\",\\\"iclass_primary_key\\\":\\\"\\\",\\\"iclass_second_key\\\":\\\"\\\",\\\"iclass_start_block_index\\\":13,\\\"desfire_primary_key\\\":\\\"\\\",\\\"desfire_second_key\\\":\\\"\\\",\\\"desfire_app_id\\\":1,\\\"desfire_file_id\\\":1,\\\"desfire_encryption_type\\\":0,\\\"desfire_advanced_mode\\\":0,\\\"des_adv_app_master_key_index\\\":0,\\\"des_adv_file_read_access_key_index\\\":1,\\\"des_adv_file_write_access_key_index\\\":2,\\\"seos_primary_key\\\":\\\"\\\",\\\"seos_second_key\\\":\\\"\\\",\\\"seos_adf\\\":\\\"2A8570811E1000070000020000\\\"}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/layouts");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"CardLayout": @{ @"name":
            @"smart_test", @"use_second_key": @NO, @"number_of_template": @2,
            @"template_size": @300, @"mifare_primary_key": @"",
            @"mifare_start_block_index": @4, @"mifare_second_key": @"",
            @"iclass_primary_key": @"", @"iclass_second_key": @"",
            @"iclass_start_block_index": @13, @"desfire_primary_key": @"",
            @"desfire_second_key": @"", @"desfire_app_id": @1,
            @"desfire_file_id": @1, @"desfire_encryption_type": @0,
            @"desfire_advanced_mode": @0, @"des_adv_app_master_key_index": @0,
            @"des_adv_file_read_access_key_index": @1,
            @"des_adv_file_write_access_key_index": @2, @"seos_primary_key":
            @"", @"seos_second_key": @"", @"seos_adf":
            @"2A8570811E1000070000020000" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/layouts"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["CardLayout": [
                "name": "smart_test",
                "use_second_key": false,
                "number_of_template": 2,
                "template_size": 300,
                "mifare_primary_key": "",
                "mifare_start_block_index": 4,
                "mifare_second_key": "",
                "iclass_primary_key": "",
                "iclass_second_key": "",
                "iclass_start_block_index": 13,
                "desfire_primary_key": "",
                "desfire_second_key": "",
                "desfire_app_id": 1,
                "desfire_file_id": 1,
                "desfire_encryption_type": 0,
                "desfire_advanced_mode": 0,
                "des_adv_app_master_key_index": 0,
                "des_adv_file_read_access_key_index": 1,
                "des_adv_file_write_access_key_index": 2,
                "seos_primary_key": "",
                "seos_second_key": "",
                "seos_adf": "2A8570811E1000070000020000"
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/layouts")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/cards/layouts");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/cards/layouts"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/layouts' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"CardLayout":{"name":"smart_test","use_second_key":false,"number_of_template":2,"template_size":300,"mifare_primary_key":"","mifare_start_block_index":4,"mifare_second_key":"","iclass_primary_key":"","iclass_second_key":"","iclass_start_block_index":13,"desfire_primary_key":"","desfire_second_key":"","desfire_app_id":1,"desfire_file_id":1,"desfire_encryption_type":0,"desfire_advanced_mode":0,"des_adv_app_master_key_index":0,"des_adv_file_read_access_key_index":1,"des_adv_file_write_access_key_index":2,"seos_primary_key":"","seos_second_key":"","seos_adf":"2A8570811E1000070000020000"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/layouts' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"CardLayout":{"name":"smart_test","use_second_key":false,"number_of_template":2,"template_size":300,"mifare_primary_key":"","mifare_start_block_index":4,"mifare_second_key":"","iclass_primary_key":"","iclass_second_key":"","iclass_start_block_index":13,"desfire_primary_key":"","desfire_second_key":"","desfire_app_id":1,"desfire_file_id":1,"desfire_encryption_type":0,"desfire_advanced_mode":0,"des_adv_app_master_key_index":0,"des_adv_file_read_access_key_index":1,"des_adv_file_write_access_key_index":2,"seos_primary_key":"","seos_second_key":"","seos_adf":"2A8570811E1000070000020000"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/layouts"


            payload <-
            "{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/cards/layouts" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"CardLayout\":{\"name\":\"smart_test\",\"use_second_key\":false,\"number_of_template\":2,\"template_size\":300,\"mifare_primary_key\":\"\",\"mifare_start_block_index\":4,\"mifare_second_key\":\"\",\"iclass_primary_key\":\"\",\"iclass_second_key\":\"\",\"iclass_start_block_index\":13,\"desfire_primary_key\":\"\",\"desfire_second_key\":\"\",\"desfire_app_id\":1,\"desfire_file_id\":1,\"desfire_encryption_type\":0,\"desfire_advanced_mode\":0,\"des_adv_app_master_key_index\":0,\"des_adv_file_read_access_key_index\":1,\"des_adv_file_write_access_key_index\":2,\"seos_primary_key\":\"\",\"seos_second_key\":\"\",\"seos_adf\":\"2A8570811E1000070000020000\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/layouts")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/cards/types:
    get:
      tags:
        - Cards
      summary: View All Card Types
      operationId: getCardTypes
      description: This API is used to view all available card types.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/cards/types \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/cards/types \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/cards/types
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/types",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/types',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/cards/types");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/types',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/cards/types';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/cards/types', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/types",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/cards/types");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/cards/types", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/cards/types"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/cards/types")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/types",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards/types');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/cards/types');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/types")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/cards/types")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/types\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/types");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/types"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/types")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/cards/types");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/cards/types"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/types' -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/types' -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/types"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/cards/types" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/types")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/cards/registered:
    get:
      tags:
        - Cards
      summary: Check Card Availability
      operationId: checkCardAvailability
      description: >-
        This API is used to check whether a card already posted on the system or
        not.


        If card already posted, then it will show the card's detail on the
        response.
      parameters:
        - name: card_id
          in: query
          schema:
            type: integer
          description: ID of the card which will be checked.
          example: 123
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/v2/cards/registered?card_id=123' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET 'https://{baseurl}/api/v2/cards/registered?card_id=123' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/v2/cards/registered?card_id=123'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/cards/registered?card_id=123",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/cards/registered',
              qs: {card_id: '123'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/cards/registered");


            req.query({
              "card_id": "123"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/cards/registered',
              params: {card_id: '123'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/cards/registered?card_id=123';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/cards/registered?card_id=123',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/cards/registered?card_id=123",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/cards/registered?card_id=123");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/cards/registered?card_id=123",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/cards/registered"


            querystring = {"card_id":"123"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/cards/registered?card_id=123")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/cards/registered?card_id=123",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/cards/registered');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'card_id' => '123'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/cards/registered');

            $request->setRequestMethod('GET');

            $request->setQuery(new http\QueryString([
              'card_id' => '123'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/cards/registered?card_id=123")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/cards/registered?card_id=123")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/cards/registered?card_id=123\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/cards/registered?card_id=123");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/cards/registered?card_id=123"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/cards/registered?card_id=123")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/cards/registered?card_id=123");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/cards/registered?card_id=123"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/cards/registered?card_id=123' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/cards/registered?card_id=123' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/cards/registered"


            queryString <- list([ 'card_id' ] = "123")


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/cards/registered?card_id=123" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/cards/registered?card_id=123")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/cards:
    get:
      tags:
        - Cards
      summary: View a Card Detail
      operationId: getCard
      description: >-
        This API is used to find a card by card ID and find out who owns the
        card.
      parameters:
        - name: query
          in: query
          schema:
            type: integer
          description: ID of the card which will be viewed
          example: 1169166509350528
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/cards?query=1169166509350528' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET 'https://{baseurl}/api/cards?query=1169166509350528' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/cards?query=1169166509350528'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards?query=1169166509350528",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards',
              qs: {query: '1169166509350528'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/cards");

            req.query({
              "query": "1169166509350528"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards',
              params: {query: '1169166509350528'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/cards?query=1169166509350528';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/cards?query=1169166509350528', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards?query=1169166509350528",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/cards?query=1169166509350528");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/cards?query=1169166509350528",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards"


            querystring = {"query":"1169166509350528"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/cards?query=1169166509350528")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards?query=1169166509350528",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'query' => '1169166509350528'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/cards');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'query' => '1169166509350528'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards?query=1169166509350528")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/cards?query=1169166509350528")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards?query=1169166509350528\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards?query=1169166509350528");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards?query=1169166509350528"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards?query=1169166509350528")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards?query=1169166509350528");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/cards?query=1169166509350528"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards?query=1169166509350528' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards?query=1169166509350528' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards"


            queryString <- list([ 'query' ] = "1169166509350528")


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/cards?query=1169166509350528" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards?query=1169166509350528")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Cards
      summary: Create BioStar X QR
      operationId: createCard
      description: >-
        This API is used to create BioStar X QR.

        **NOTE**: This API will return error if the card_id already exists in
        the database. Use Check [Card Availability](#checkCardAvailability) API
        to validate.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CardInput'
      responses:
        '200':
          description: Card created successfully
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/cards \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"CardCollection":{"rows":[{"card_type":{"id":7,"type":7},"display_card_id":33333333333,"card_id":33333333333}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"CardCollection":{"rows":[{"card_type":{"id":7,"type":7},"display_card_id":33333333333,"card_id":33333333333}]}}'
            |  \
              http POST https://{baseurl}/api/cards \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"CardCollection":{"rows":[{"card_type":{"id":7,"type":7},"display_card_id":33333333333,"card_id":33333333333}]}}' \
              --output-document \
              - https://{baseurl}/api/cards
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              CardCollection: {
                rows: [
                  {
                    card_type: {id: 7, type: 7},
                    display_card_id: 33333333333,
                    card_id: 33333333333
                  }
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/cards',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                CardCollection: {
                  rows: [
                    {
                      card_type: {id: 7, type: 7},
                      display_card_id: 33333333333,
                      card_id: 33333333333
                    }
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/cards");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "CardCollection": {
                "rows": [
                  {
                    "card_type": {
                      "id": 7,
                      "type": 7
                    },
                    "display_card_id": 33333333333,
                    "card_id": 33333333333
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/cards',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                CardCollection: {
                  rows: [
                    {
                      card_type: {id: 7, type: 7},
                      display_card_id: 33333333333,
                      card_id: 33333333333
                    }
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/cards';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"CardCollection":{"rows":[{"card_type":{"id":7,"type":7},"display_card_id":33333333333,"card_id":33333333333}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"CardCollection":{"rows":[{"card_type":{"id":7,"type":7},"display_card_id":33333333333,"card_id":33333333333}]}}'
            };

            fetch('https://{baseurl}/api/cards', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "CardCollection": {
                "rows": [
                  {
                    "card_type": {
                      "id": 7,
                      "type": 7
                    },
                    "display_card_id": 33333333333,
                    "card_id": 33333333333
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/cards");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/cards", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards"


            payload = {"CardCollection": {"rows": [
                        {
                            "card_type": {
                                "id": 7,
                                "type": 7
                            },
                            "display_card_id": 33333333333,
                            "card_id": 33333333333
                        }
                    ]}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/cards")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/cards');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"CardCollection":{"rows":[{"card_type":{"id":7,"type":7},"display_card_id":33333333333,"card_id":33333333333}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"CardCollection":{"rows":[{"card_type":{"id":7,"type":7},"display_card_id":33333333333,"card_id":33333333333}]}}');


            $request->setRequestUrl('https://{baseurl}/api/cards');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/cards")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards\"\n\n\tpayload := strings.NewReader(\"{\\\"CardCollection\\\":{\\\"rows\\\":[{\\\"card_type\\\":{\\\"id\\\":7,\\\"type\\\":7},\\\"display_card_id\\\":33333333333,\\\"card_id\\\":33333333333}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL, "https://{baseurl}/api/cards");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"CardCollection": @{ @"rows": @[ @{
            @"card_type": @{ @"id": @7, @"type": @7 }, @"display_card_id":
            @33333333333, @"card_id": @33333333333 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL URLWithString:@"https://{baseurl}/api/cards"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["CardCollection": ["rows": [
                  [
                    "card_type": [
                      "id": 7,
                      "type": 7
                    ],
                    "display_card_id": 33333333333,
                    "card_id": 33333333333
                  ]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/cards");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/cards"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/cards'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"CardCollection":{"rows":[{"card_type":{"id":7,"type":7},"display_card_id":33333333333,"card_id":33333333333}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/cards'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"CardCollection":{"rows":[{"card_type":{"id":7,"type":7},"display_card_id":33333333333,"card_id":33333333333}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards"


            payload <-
            "{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/cards" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"CardCollection\":{\"rows\":[{\"card_type\":{\"id\":7,\"type\":7},\"display_card_id\":33333333333,\"card_id\":33333333333}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/cards/unassigned:
    get:
      tags:
        - Cards
      summary: List Unassigned Cards
      operationId: getUnassignedCards
      description: This API is used to view all unassigned cards recorded on BioStar X.
      parameters:
        - name: card_type
          in: query
          schema:
            type: string
          description: >-
            Limit the response to show only the specified type of card. Use plus
            (+) sign as separator to filter by multiple types.
          example: csn
        - name: limit
          in: query
          schema:
            type: string
          description: >-
            Limit the number of responses by n records. Remove this parameter to
            view all.
          example: 'null'
        - name: offset
          in: query
          schema:
            type: string
          description: Offset the response shown by n records.
          example: 'null'
        - name: wiegand_format_id
          in: query
          schema:
            type: integer
          description: >-
            Limit the response to show only the specified wiegand format. Remove
            this parameter to show all.
          example: 4
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/unassigned',
              qs: {card_type: 'csn', limit: 'null', offset: 'null', wiegand_format_id: '4'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/cards/unassigned");


            req.query({
              "card_type": "csn",
              "limit": "null",
              "offset": "null",
              "wiegand_format_id": "4"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/unassigned',
              params: {card_type: 'csn', limit: 'null', offset: 'null', wiegand_format_id: '4'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards/unassigned"


            querystring =
            {"card_type":"csn","limit":"null","offset":"null","wiegand_format_id":"4"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards/unassigned');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'card_type' => 'csn',
              'limit' => 'null',
              'offset' => 'null',
              'wiegand_format_id' => '4'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/cards/unassigned');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'card_type' => 'csn',
              'limit' => 'null',
              'offset' => 'null',
              'wiegand_format_id' => '4'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/unassigned"


            queryString <- list(
              card_type = "csn",
              limit = "null",
              offset = "null"
              wiegand_format_id = "4",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/unassigned?card_type=csn&limit=null&offset=null&wiegand_format_id=4")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/cards/assigned:
    get:
      tags:
        - Cards
      summary: List Assigned Cards
      operationId: getAssignedCards
      description: This API is used to view all assigned cards recorded on BioStar X.
      parameters:
        - name: card_type
          in: query
          schema:
            type: string
          description: >-
            Limit the response to show only the specified type of card. Use plus
            (+) sign as separator to filter by multiple types.
          example: wiegand
        - name: offset
          in: query
          schema:
            type: integer
          description: Offset the response shown by n records.
          example: 0
        - name: wiegand_format_id
          in: query
          schema:
            type: string
          description: >-
            Limit the response to show only the specified wiegand format. Remove
            this parameter to show all.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/assigned',
              qs: {card_type: 'wiegand', offset: '0', wiegand_format_id: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/cards/assigned");

            req.query({
              "card_type": "wiegand",
              "offset": "0",
              "wiegand_format_id": "SOME_STRING_VALUE"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/assigned',
              params: {card_type: 'wiegand', offset: '0', wiegand_format_id: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards/assigned"


            querystring =
            {"card_type":"wiegand","offset":"0","wiegand_format_id":"SOME_STRING_VALUE"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards/assigned');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'card_type' => 'wiegand',
              'offset' => '0',
              'wiegand_format_id' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/cards/assigned');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'card_type' => 'wiegand',
              'offset' => '0',
              'wiegand_format_id' => 'SOME_STRING_VALUE'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/assigned"


            queryString <- list(
              card_type = "wiegand",
              offset = "0"
              wiegand_format_id = "SOME_STRING_VALUE",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/assigned?card_type=wiegand&offset=0&wiegand_format_id=SOME_STRING_VALUE")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/cards/blacklist:
    get:
      tags:
        - Cards
      summary: List Blacklisted Cards
      operationId: getBlacklistedCards
      description: This API is used to view all blacklisted cards recorded on BioStar X.
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
          description: >-
            Limit the number of responses by n records. Remove this parameter to
            view all.
          example: 1000
        - name: offset
          in: query
          schema:
            type: integer
          description: Offset the response shown by n records.
          example: 0
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/cards/blacklist?limit=1000&offset=0' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET 'https://{baseurl}/api/cards/blacklist?limit=1000&offset=0'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/cards/blacklist?limit=1000&offset=0'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/blacklist?limit=1000&offset=0",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/blacklist',
              qs: {limit: '1000', offset: '0'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/cards/blacklist");

            req.query({
              "limit": "1000",
              "offset": "0"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/blacklist',
              params: {limit: '1000', offset: '0'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/cards/blacklist?limit=1000&offset=0';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/cards/blacklist?limit=1000&offset=0',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/blacklist?limit=1000&offset=0",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/cards/blacklist?limit=1000&offset=0");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/cards/blacklist?limit=1000&offset=0",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards/blacklist"


            querystring = {"limit":"1000","offset":"0"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/cards/blacklist?limit=1000&offset=0")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/blacklist?limit=1000&offset=0",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards/blacklist');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => '1000',
              'offset' => '0'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/cards/blacklist');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'limit' => '1000',
              'offset' => '0'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/blacklist?limit=1000&offset=0")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/cards/blacklist?limit=1000&offset=0")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/blacklist?limit=1000&offset=0\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/blacklist?limit=1000&offset=0");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/blacklist?limit=1000&offset=0"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/blacklist?limit=1000&offset=0")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/blacklist?limit=1000&offset=0");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/cards/blacklist?limit=1000&offset=0"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/blacklist?limit=1000&offset=0' -Method
            GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/blacklist?limit=1000&offset=0' -Method
            GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/blacklist"


            queryString <- list(
              limit = "1000"
              offset = "0",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/cards/blacklist?limit=1000&offset=0" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/blacklist?limit=1000&offset=0")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Cards
      summary: Delete Blacklisted Card
      operationId: removeFromBlacklist
      description: This API is used to remove a blacklisted card from the list.
      parameters:
        - name: id
          in: query
          schema:
            type: integer
          description: ID of the blacklisted card which will be removed from the list.
          example: 50
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/cards/blacklist?id=50' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE 'https://{baseurl}/api/cards/blacklist?id=50' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/cards/blacklist?id=50'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/blacklist?id=50",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/cards/blacklist',
              qs: {id: '50'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/cards/blacklist");


            req.query({
              "id": "50"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/cards/blacklist',
              params: {id: '50'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/cards/blacklist?id=50';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/cards/blacklist?id=50', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/blacklist?id=50",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/cards/blacklist?id=50");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/cards/blacklist?id=50",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards/blacklist"


            querystring = {"id":"50"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/cards/blacklist?id=50")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/blacklist?id=50",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards/blacklist');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => '50'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/cards/blacklist');
            $request->setRequestMethod('DELETE');
            $request->setQuery(new http\QueryString([
              'id' => '50'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/blacklist?id=50")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/cards/blacklist?id=50")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/blacklist?id=50\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/blacklist?id=50");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/blacklist?id=50"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/blacklist?id=50")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/blacklist?id=50");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/cards/blacklist?id=50"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/blacklist?id=50' -Method DELETE
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/blacklist?id=50' -Method DELETE
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/blacklist"


            queryString <- list([ 'id' ] = "50")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/cards/blacklist?id=50" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/blacklist?id=50")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Cards
      summary: Blacklist Card
      operationId: addToBlacklist
      description: This API is used to add a card to blacklist.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Input for adding a card to blacklist
              required:
                - Blacklist
              properties:
                Blacklist:
                  type: object
                  required:
                    - card_id
                  properties:
                    card_id:
                      type: object
                      description: Card identifier information
                      required:
                        - id
                      properties:
                        id:
                          type: integer
                          description: ID of the card which will be added to the blacklist
                          example: 49
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/cards/blacklist \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Blacklist":{"card_id":{"id":49}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"Blacklist":{"card_id":{"id":49}}}' |  \
              http POST https://{baseurl}/api/cards/blacklist \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Blacklist":{"card_id":{"id":49}}}' \
              --output-document \
              - https://{baseurl}/api/cards/blacklist
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/blacklist",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({Blacklist: {card_id: {id: 49}}}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/cards/blacklist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {Blacklist: {card_id: {id: 49}}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/cards/blacklist");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "Blacklist": {
                "card_id": {
                  "id": 49
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/cards/blacklist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {Blacklist: {card_id: {id: 49}}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/cards/blacklist';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Blacklist":{"card_id":{"id":49}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Blacklist":{"card_id":{"id":49}}}'
            };

            fetch('https://{baseurl}/api/cards/blacklist', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/blacklist",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Blacklist\":{\"card_id\":{\"id\":49}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Blacklist": {
                "card_id": {
                  "id": 49
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/cards/blacklist");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"Blacklist\":{\"card_id\":{\"id\":49}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/cards/blacklist", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards/blacklist"


            payload = {"Blacklist": {"card_id": {"id": 49}}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/cards/blacklist")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"Blacklist\":{\"card_id\":{\"id\":49}}}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/blacklist",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Blacklist\":{\"card_id\":{\"id\":49}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards/blacklist');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"Blacklist":{"card_id":{"id":49}}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"Blacklist":{"card_id":{"id":49}}}');

            $request->setRequestUrl('https://{baseurl}/api/cards/blacklist');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Blacklist\":{\"card_id\":{\"id\":49}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/blacklist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/cards/blacklist")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Blacklist\":{\"card_id\":{\"id\":49}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/blacklist\"\n\n\tpayload := strings.NewReader(\"{\\\"Blacklist\\\":{\\\"card_id\\\":{\\\"id\\\":49}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/blacklist");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Blacklist\":{\"card_id\":{\"id\":49}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Blacklist": @{ @"card_id": @{ @"id":
            @49 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/blacklist"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Blacklist": ["card_id": ["id": 49]]] as [String :
            Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/blacklist")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/blacklist");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Blacklist\":{\"card_id\":{\"id\":49}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/cards/blacklist"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Blacklist\":{\"card_id\":{\"id\":49}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/blacklist' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Blacklist":{"card_id":{"id":49}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/blacklist' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Blacklist":{"card_id":{"id":49}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/blacklist"


            payload <- "{\"Blacklist\":{\"card_id\":{\"id\":49}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/cards/blacklist" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Blacklist\":{\"card_id\":{\"id\":49}}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Blacklist\":{\"card_id\":{\"id\":49}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/blacklist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/cards/wiegand_formats:
    get:
      tags:
        - Cards
      summary: View Wiegand Formats
      operationId: viewWiegandFormat
      description: This API is used to view all available wiegand format.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/cards/wiegand_formats \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/cards/wiegand_formats \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/cards/wiegand_formats
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/wiegand_formats",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/wiegand_formats',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/cards/wiegand_formats");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/wiegand_formats',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/cards/wiegand_formats';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/cards/wiegand_formats', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/wiegand_formats",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/cards/wiegand_formats");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/cards/wiegand_formats",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/cards/wiegand_formats"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/cards/wiegand_formats")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/wiegand_formats",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards/wiegand_formats');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/cards/wiegand_formats');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/wiegand_formats")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/cards/wiegand_formats")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/wiegand_formats\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/wiegand_formats");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/wiegand_formats"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/wiegand_formats")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/wiegand_formats");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/cards/wiegand_formats"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/wiegand_formats' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/wiegand_formats' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/wiegand_formats"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/cards/wiegand_formats" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/wiegand_formats")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/cards/layouts/{id}:
    get:
      tags:
        - Cards
      summary: View a Smart Card Layout Details
      operationId: viewCardLayouts
      description: This API is used to view a smart card layout details.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the card layout which will be viewed.
          example: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/cards/layouts/1 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/cards/layouts/1 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/cards/layouts/1
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/layouts/1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/layouts/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/cards/layouts/1");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/cards/layouts/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/cards/layouts/1';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/cards/layouts/1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/layouts/1",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/cards/layouts/1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/cards/layouts/1",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/cards/layouts/1"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/cards/layouts/1")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/layouts/1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/cards/layouts/1');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/cards/layouts/1');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/layouts/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/cards/layouts/1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/layouts/1\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/layouts/1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/layouts/1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/layouts/1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/layouts/1");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/cards/layouts/1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/layouts/1' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/layouts/1' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/layouts/1"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/cards/layouts/1" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/layouts/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{device_id}/write_card:
    post:
      tags:
        - Cards
        - Device
      summary: Write Card Data
      operationId: createDeviceWriteCard
      description: >-
        This API is used to create Access on Card and write data to a card
        (Smart Card, etc.) using the specified device. The device must have a
        Smart Card layout configured before running this API.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccessOnCardInput'
      parameters:
        - name: device_id
          in: path
          schema:
            type: integer
          required: true
          description: >-
            ID of the device which will be used to write the card. Do set the
            Smart Card layout of the device before running this API.
          example: 542353521
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/542353521/write_card \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"SmartCard":{"user_id":{"user_id":8,"fingerprint_templates":[{"finger_index":0}],"visual_face_templates":[]},"card_id":{"card_id":8,"card_type_id":{"id":3},"use_alphanumeric_user_id":false}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"SmartCard":{"user_id":{"user_id":8,"fingerprint_templates":[{"finger_index":0}],"visual_face_templates":[]},"card_id":{"card_id":8,"card_type_id":{"id":3},"use_alphanumeric_user_id":false}}}'
            |  \
              http POST https://{baseurl}/api/devices/542353521/write_card \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"SmartCard":{"user_id":{"user_id":8,"fingerprint_templates":[{"finger_index":0}],"visual_face_templates":[]},"card_id":{"card_id":8,"card_type_id":{"id":3},"use_alphanumeric_user_id":false}}}' \
              --output-document \
              - https://{baseurl}/api/devices/542353521/write_card
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/542353521/write_card",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              SmartCard: {
                user_id: {
                  user_id: 8,
                  fingerprint_templates: [{finger_index: 0}],
                  visual_face_templates: []
                },
                card_id: {card_id: 8, card_type_id: {id: 3}, use_alphanumeric_user_id: false}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/542353521/write_card',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                SmartCard: {
                  user_id: {
                    user_id: 8,
                    fingerprint_templates: [{finger_index: 0}],
                    visual_face_templates: []
                  },
                  card_id: {card_id: 8, card_type_id: {id: 3}, use_alphanumeric_user_id: false}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/542353521/write_card");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "SmartCard": {
                "user_id": {
                  "user_id": 8,
                  "fingerprint_templates": [
                    {
                      "finger_index": 0
                    }
                  ],
                  "visual_face_templates": []
                },
                "card_id": {
                  "card_id": 8,
                  "card_type_id": {
                    "id": 3
                  },
                  "use_alphanumeric_user_id": false
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/542353521/write_card',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                SmartCard: {
                  user_id: {
                    user_id: 8,
                    fingerprint_templates: [{finger_index: 0}],
                    visual_face_templates: []
                  },
                  card_id: {card_id: 8, card_type_id: {id: 3}, use_alphanumeric_user_id: false}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/devices/542353521/write_card';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"SmartCard":{"user_id":{"user_id":8,"fingerprint_templates":[{"finger_index":0}],"visual_face_templates":[]},"card_id":{"card_id":8,"card_type_id":{"id":3},"use_alphanumeric_user_id":false}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"SmartCard":{"user_id":{"user_id":8,"fingerprint_templates":[{"finger_index":0}],"visual_face_templates":[]},"card_id":{"card_id":8,"card_type_id":{"id":3},"use_alphanumeric_user_id":false}}}'
            };

            fetch('https://{baseurl}/api/devices/542353521/write_card', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/542353521/write_card",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "SmartCard": {
                "user_id": {
                  "user_id": 8,
                  "fingerprint_templates": [
                    {
                      "finger_index": 0
                    }
                  ],
                  "visual_face_templates": []
                },
                "card_id": {
                  "card_id": 8,
                  "card_type_id": {
                    "id": 3
                  },
                  "use_alphanumeric_user_id": false
                }
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/devices/542353521/write_card");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/devices/542353521/write_card",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/542353521/write_card"


            payload = {"SmartCard": {
                    "user_id": {
                        "user_id": 8,
                        "fingerprint_templates": [{"finger_index": 0}],
                        "visual_face_templates": []
                    },
                    "card_id": {
                        "card_id": 8,
                        "card_type_id": {"id": 3},
                        "use_alphanumeric_user_id": False
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/devices/542353521/write_card")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/542353521/write_card",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/542353521/write_card');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"SmartCard":{"user_id":{"user_id":8,"fingerprint_templates":[{"finger_index":0}],"visual_face_templates":[]},"card_id":{"card_id":8,"card_type_id":{"id":3},"use_alphanumeric_user_id":false}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"SmartCard":{"user_id":{"user_id":8,"fingerprint_templates":[{"finger_index":0}],"visual_face_templates":[]},"card_id":{"card_id":8,"card_type_id":{"id":3},"use_alphanumeric_user_id":false}}}');


            $request->setRequestUrl('https://{baseurl}/api/devices/542353521/write_card');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/542353521/write_card")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/542353521/write_card")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/542353521/write_card\"\n\n\tpayload := strings.NewReader(\"{\\\"SmartCard\\\":{\\\"user_id\\\":{\\\"user_id\\\":8,\\\"fingerprint_templates\\\":[{\\\"finger_index\\\":0}],\\\"visual_face_templates\\\":[]},\\\"card_id\\\":{\\\"card_id\\\":8,\\\"card_type_id\\\":{\\\"id\\\":3},\\\"use_alphanumeric_user_id\\\":false}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/542353521/write_card");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"SmartCard": @{ @"user_id": @{
            @"user_id": @8, @"fingerprint_templates": @[ @{ @"finger_index": @0
            } ], @"visual_face_templates": @[  ] }, @"card_id": @{ @"card_id":
            @8, @"card_type_id": @{ @"id": @3 }, @"use_alphanumeric_user_id":
            @NO } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/542353521/write_card"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["SmartCard": [
                "user_id": [
                  "user_id": 8,
                  "fingerprint_templates": [["finger_index": 0]],
                  "visual_face_templates": []
                ],
                "card_id": [
                  "card_id": 8,
                  "card_type_id": ["id": 3],
                  "use_alphanumeric_user_id": false
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/542353521/write_card")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/542353521/write_card");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/542353521/write_card"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/542353521/write_card' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"SmartCard":{"user_id":{"user_id":8,"fingerprint_templates":[{"finger_index":0}],"visual_face_templates":[]},"card_id":{"card_id":8,"card_type_id":{"id":3},"use_alphanumeric_user_id":false}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/542353521/write_card' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"SmartCard":{"user_id":{"user_id":8,"fingerprint_templates":[{"finger_index":0}],"visual_face_templates":[]},"card_id":{"card_id":8,"card_type_id":{"id":3},"use_alphanumeric_user_id":false}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/542353521/write_card"


            payload <-
            "{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/542353521/write_card" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"SmartCard\":{\"user_id\":{\"user_id\":8,\"fingerprint_templates\":[{\"finger_index\":0}],\"visual_face_templates\":[]},\"card_id\":{\"card_id\":8,\"card_type_id\":{\"id\":3},\"use_alphanumeric_user_id\":false}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/542353521/write_card")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/cards/mobile_credentials:
    post:
      tags:
        - Cards
      summary: Create Mobile Card
      operationId: createCardMobileCredentials
      description: This API is used to create Mobile Card.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MobileCardInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/cards/mobile_credentials \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"SmartCard":{"user_id":{"user_id":1,"fingerprint_templates":[{"finger_index":0}]},"card_id":{"card_id":102,"card_type_id":{"id":2}},"card_layout_id":{"id":4},"options":{"is_a_mobile_credential":true}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"SmartCard":{"user_id":{"user_id":1,"fingerprint_templates":[{"finger_index":0}]},"card_id":{"card_id":102,"card_type_id":{"id":2}},"card_layout_id":{"id":4},"options":{"is_a_mobile_credential":true}}}'
            |  \
              http POST https://{baseurl}/api/cards/mobile_credentials \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"SmartCard":{"user_id":{"user_id":1,"fingerprint_templates":[{"finger_index":0}]},"card_id":{"card_id":102,"card_type_id":{"id":2}},"card_layout_id":{"id":4},"options":{"is_a_mobile_credential":true}}}' \
              --output-document \
              - https://{baseurl}/api/cards/mobile_credentials
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/cards/mobile_credentials",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              SmartCard: {
                user_id: {user_id: 1, fingerprint_templates: [{finger_index: 0}]},
                card_id: {card_id: 102, card_type_id: {id: 2}},
                card_layout_id: {id: 4},
                options: {is_a_mobile_credential: true}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/cards/mobile_credentials',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                SmartCard: {
                  user_id: {user_id: 1, fingerprint_templates: [{finger_index: 0}]},
                  card_id: {card_id: 102, card_type_id: {id: 2}},
                  card_layout_id: {id: 4},
                  options: {is_a_mobile_credential: true}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/cards/mobile_credentials");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "SmartCard": {
                "user_id": {
                  "user_id": 1,
                  "fingerprint_templates": [
                    {
                      "finger_index": 0
                    }
                  ]
                },
                "card_id": {
                  "card_id": 102,
                  "card_type_id": {
                    "id": 2
                  }
                },
                "card_layout_id": {
                  "id": 4
                },
                "options": {
                  "is_a_mobile_credential": true
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/cards/mobile_credentials',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                SmartCard: {
                  user_id: {user_id: 1, fingerprint_templates: [{finger_index: 0}]},
                  card_id: {card_id: 102, card_type_id: {id: 2}},
                  card_layout_id: {id: 4},
                  options: {is_a_mobile_credential: true}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/cards/mobile_credentials';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"SmartCard":{"user_id":{"user_id":1,"fingerprint_templates":[{"finger_index":0}]},"card_id":{"card_id":102,"card_type_id":{"id":2}},"card_layout_id":{"id":4},"options":{"is_a_mobile_credential":true}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"SmartCard":{"user_id":{"user_id":1,"fingerprint_templates":[{"finger_index":0}]},"card_id":{"card_id":102,"card_type_id":{"id":2}},"card_layout_id":{"id":4},"options":{"is_a_mobile_credential":true}}}'
            };

            fetch('https://{baseurl}/api/cards/mobile_credentials', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/cards/mobile_credentials",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "SmartCard": {
                "user_id": {
                  "user_id": 1,
                  "fingerprint_templates": [
                    {
                      "finger_index": 0
                    }
                  ]
                },
                "card_id": {
                  "card_id": 102,
                  "card_type_id": {
                    "id": 2
                  }
                },
                "card_layout_id": {
                  "id": 4
                },
                "options": {
                  "is_a_mobile_credential": true
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/cards/mobile_credentials");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/cards/mobile_credentials",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/cards/mobile_credentials"


            payload = {"SmartCard": {
                    "user_id": {
                        "user_id": 1,
                        "fingerprint_templates": [{"finger_index": 0}]
                    },
                    "card_id": {
                        "card_id": 102,
                        "card_type_id": {"id": 2}
                    },
                    "card_layout_id": {"id": 4},
                    "options": {"is_a_mobile_credential": True}
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/cards/mobile_credentials")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/cards/mobile_credentials",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/cards/mobile_credentials');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"SmartCard":{"user_id":{"user_id":1,"fingerprint_templates":[{"finger_index":0}]},"card_id":{"card_id":102,"card_type_id":{"id":2}},"card_layout_id":{"id":4},"options":{"is_a_mobile_credential":true}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"SmartCard":{"user_id":{"user_id":1,"fingerprint_templates":[{"finger_index":0}]},"card_id":{"card_id":102,"card_type_id":{"id":2}},"card_layout_id":{"id":4},"options":{"is_a_mobile_credential":true}}}');


            $request->setRequestUrl('https://{baseurl}/api/cards/mobile_credentials');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/cards/mobile_credentials")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/cards/mobile_credentials")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/cards/mobile_credentials\"\n\n\tpayload := strings.NewReader(\"{\\\"SmartCard\\\":{\\\"user_id\\\":{\\\"user_id\\\":1,\\\"fingerprint_templates\\\":[{\\\"finger_index\\\":0}]},\\\"card_id\\\":{\\\"card_id\\\":102,\\\"card_type_id\\\":{\\\"id\\\":2}},\\\"card_layout_id\\\":{\\\"id\\\":4},\\\"options\\\":{\\\"is_a_mobile_credential\\\":true}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/cards/mobile_credentials");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"SmartCard": @{ @"user_id": @{
            @"user_id": @1, @"fingerprint_templates": @[ @{ @"finger_index": @0
            } ] }, @"card_id": @{ @"card_id": @102, @"card_type_id": @{ @"id":
            @2 } }, @"card_layout_id": @{ @"id": @4 }, @"options": @{
            @"is_a_mobile_credential": @YES } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/cards/mobile_credentials"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["SmartCard": [
                "user_id": [
                  "user_id": 1,
                  "fingerprint_templates": [["finger_index": 0]]
                ],
                "card_id": [
                  "card_id": 102,
                  "card_type_id": ["id": 2]
                ],
                "card_layout_id": ["id": 4],
                "options": ["is_a_mobile_credential": true]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/cards/mobile_credentials")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/cards/mobile_credentials");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/cards/mobile_credentials"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/cards/mobile_credentials' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"SmartCard":{"user_id":{"user_id":1,"fingerprint_templates":[{"finger_index":0}]},"card_id":{"card_id":102,"card_type_id":{"id":2}},"card_layout_id":{"id":4},"options":{"is_a_mobile_credential":true}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/cards/mobile_credentials' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"SmartCard":{"user_id":{"user_id":1,"fingerprint_templates":[{"finger_index":0}]},"card_id":{"card_id":102,"card_type_id":{"id":2}},"card_layout_id":{"id":4},"options":{"is_a_mobile_credential":true}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/cards/mobile_credentials"


            payload <-
            "{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/cards/mobile_credentials" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"SmartCard\":{\"user_id\":{\"user_id\":1,\"fingerprint_templates\":[{\"finger_index\":0}]},\"card_id\":{\"card_id\":102,\"card_type_id\":{\"id\":2}},\"card_layout_id\":{\"id\":4},\"options\":{\"is_a_mobile_credential\":true}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/cards/mobile_credentials")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{dev_id}/erase_card:
    post:
      tags:
        - Cards
      summary: Format Smart Card
      operationId: createDeviceEraseCard
      description: >-
        This API is used to remove the written smart card data from a Smart
        Card.
      requestBody:
        content: {}
      parameters:
        - name: dev_id
          in: path
          schema:
            type: string
          required: true
          description: >-
            Device ID with the corresponding layout set which will be used to
            write the card.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/{dev_id}/erase_card \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http POST https://{baseurl}/api/devices/{dev_id}/erase_card \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices/{dev_id}/erase_card
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/{dev_id}/erase_card",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/{dev_id}/erase_card',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/{dev_id}/erase_card");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/{dev_id}/erase_card',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices/{dev_id}/erase_card';


            let options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/{dev_id}/erase_card', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/{dev_id}/erase_card",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/devices/{dev_id}/erase_card");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("POST", "{baseurl}/api/devices/{dev_id}/erase_card",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices/{dev_id}/erase_card"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("POST", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/{dev_id}/erase_card")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/{dev_id}/erase_card",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/{dev_id}/erase_card');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/{dev_id}/erase_card');

            $request->setRequestMethod('POST');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/{dev_id}/erase_card")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/{dev_id}/erase_card")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/{dev_id}/erase_card\"\n\n\treq, _ := http.NewRequest(\"POST\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/{dev_id}/erase_card");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/{dev_id}/erase_card"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/{dev_id}/erase_card")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/{dev_id}/erase_card");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/{dev_id}/erase_card"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/{dev_id}/erase_card' -Method POST
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/{dev_id}/erase_card' -Method POST
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/{dev_id}/erase_card"


            response <- VERB("POST", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/{dev_id}/erase_card" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/{dev_id}/erase_card")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/send_email_qr:
    post:
      tags:
        - Cards
      summary: Send BioStar X QR by Email
      operationId: createSendEmailQr
      description: |-
        This API is used to send BioStar X QR by email.

        Before using this API, make sure that:
        - SMTP is set
        - User email field is filled
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailQRInput'
      responses:
        '200':
          description: QR code email sent successfully
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/send_email_qr \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"id":1,"language":"en","card_collection":[{"id":10072,"card_id":3.045804110617691e+33,"display_card_id":165113371684849,"card_type":{"id":7,"name":"SCQr","type":7}}],"total":1}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"id":1,"language":"en","card_collection":[{"id":10072,"card_id":3.045804110617691e+33,"display_card_id":165113371684849,"card_type":{"id":7,"name":"SCQr","type":7}}],"total":1}'
            |  \
              http POST https://{baseurl}/api/v2/send_email_qr \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"id":1,"language":"en","card_collection":[{"id":10072,"card_id":3.045804110617691e+33,"display_card_id":165113371684849,"card_type":{"id":7,"name":"SCQr","type":7}}],"total":1}' \
              --output-document \
              - https://{baseurl}/api/v2/send_email_qr
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/send_email_qr",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              id: 1,
              language: 'en',
              card_collection: [
                {
                  id: 10072,
                  card_id: 3.045804110617691e+33,
                  display_card_id: 165113371684849,
                  card_type: {id: 7, name: 'SCQr', type: 7}
                }
              ],
              total: 1
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/send_email_qr',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                id: 1,
                language: 'en',
                card_collection: [
                  {
                    id: 10072,
                    card_id: 3.045804110617691e+33,
                    display_card_id: 165113371684849,
                    card_type: {id: 7, name: 'SCQr', type: 7}
                  }
                ],
                total: 1
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/send_email_qr");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "id": 1,
              "language": "en",
              "card_collection": [
                {
                  "id": 10072,
                  "card_id": 3.045804110617691e+33,
                  "display_card_id": 165113371684849,
                  "card_type": {
                    "id": 7,
                    "name": "SCQr",
                    "type": 7
                  }
                }
              ],
              "total": 1
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/send_email_qr',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                id: 1,
                language: 'en',
                card_collection: [
                  {
                    id: 10072,
                    card_id: 3.045804110617691e+33,
                    display_card_id: 165113371684849,
                    card_type: {id: 7, name: 'SCQr', type: 7}
                  }
                ],
                total: 1
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/send_email_qr';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"id":1,"language":"en","card_collection":[{"id":10072,"card_id":3.045804110617691e+33,"display_card_id":165113371684849,"card_type":{"id":7,"name":"SCQr","type":7}}],"total":1}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"id":1,"language":"en","card_collection":[{"id":10072,"card_id":3.045804110617691e+33,"display_card_id":165113371684849,"card_type":{"id":7,"name":"SCQr","type":7}}],"total":1}'
            };

            fetch('https://{baseurl}/api/v2/send_email_qr', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/send_email_qr",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "id": 1,
              "language": "en",
              "card_collection": [
                {
                  "id": 10072,
                  "card_id": 3.045804110617691e+33,
                  "display_card_id": 165113371684849,
                  "card_type": {
                    "id": 7,
                    "name": "SCQr",
                    "type": 7
                  }
                }
              ],
              "total": 1
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/send_email_qr");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/send_email_qr", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/send_email_qr"


            payload = {
                "id": 1,
                "language": "en",
                "card_collection": [
                    {
                        "id": 10072,
                        "card_id": 3.045804110617691e+33,
                        "display_card_id": 165113371684849,
                        "card_type": {
                            "id": 7,
                            "name": "SCQr",
                            "type": 7
                        }
                    }
                ],
                "total": 1
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/send_email_qr")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/send_email_qr",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/send_email_qr');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"id":1,"language":"en","card_collection":[{"id":10072,"card_id":3.045804110617691e+33,"display_card_id":165113371684849,"card_type":{"id":7,"name":"SCQr","type":7}}],"total":1}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"id":1,"language":"en","card_collection":[{"id":10072,"card_id":3.045804110617691e+33,"display_card_id":165113371684849,"card_type":{"id":7,"name":"SCQr","type":7}}],"total":1}');


            $request->setRequestUrl('https://{baseurl}/api/v2/send_email_qr');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/send_email_qr")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/send_email_qr")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/send_email_qr\"\n\n\tpayload := strings.NewReader(\"{\\\"id\\\":1,\\\"language\\\":\\\"en\\\",\\\"card_collection\\\":[{\\\"id\\\":10072,\\\"card_id\\\":3.045804110617691e+33,\\\"display_card_id\\\":165113371684849,\\\"card_type\\\":{\\\"id\\\":7,\\\"name\\\":\\\"SCQr\\\",\\\"type\\\":7}}],\\\"total\\\":1}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/send_email_qr");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"id": @1,
                                          @"language": @"en",
                                          @"card_collection": @[ @{ @"id": @10072, @"card_id": @3.045804110617691e+33, @"display_card_id": @165113371684849, @"card_type": @{ @"id": @7, @"name": @"SCQr", @"type": @7 } } ],
                                          @"total": @1 };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/send_email_qr"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "id": 1,
              "language": "en",
              "card_collection": [
                [
                  "id": 10072,
                  "card_id": 3.045804110617691e+33,
                  "display_card_id": 165113371684849,
                  "card_type": [
                    "id": 7,
                    "name": "SCQr",
                    "type": 7
                  ]
                ]
              ],
              "total": 1
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/send_email_qr")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/send_email_qr");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/send_email_qr"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/send_email_qr' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"id":1,"language":"en","card_collection":[{"id":10072,"card_id":3.045804110617691e+33,"display_card_id":165113371684849,"card_type":{"id":7,"name":"SCQr","type":7}}],"total":1}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/send_email_qr' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"id":1,"language":"en","card_collection":[{"id":10072,"card_id":3.045804110617691e+33,"display_card_id":165113371684849,"card_type":{"id":7,"name":"SCQr","type":7}}],"total":1}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/send_email_qr"


            payload <-
            "{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/send_email_qr" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"id\":1,\"language\":\"en\",\"card_collection\":[{\"id\":10072,\"card_id\":3.045804110617691e+33,\"display_card_id\":165113371684849,\"card_type\":{\"id\":7,\"name\":\"SCQr\",\"type\":7}}],\"total\":1}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/send_email_qr")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/send_email:
    post:
      tags:
        - Cards
      summary: Send Visual Face by Email
      operationId: createSendEmail
      description: This API is used to send Visual Face mobile enrollment link.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VisualFaceEmailInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/send_email \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"id":"1","language":"en","adv_criteria":{"user_name":"e","user_operator_level_id":"0","user_group_id":1,"user_group_ids":[],"user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"id":"1","language":"en","adv_criteria":{"user_name":"e","user_operator_level_id":"0","user_group_id":1,"user_group_ids":[],"user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string"}}'
            |  \
              http POST https://{baseurl}/api/v2/send_email \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"id":"1","language":"en","adv_criteria":{"user_name":"e","user_operator_level_id":"0","user_group_id":1,"user_group_ids":[],"user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string"}}' \
              --output-document \
              - https://{baseurl}/api/v2/send_email
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/send_email",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              id: '1',
              language: 'en',
              adv_criteria: {
                user_name: 'e',
                user_operator_level_id: '0',
                user_group_id: 1,
                user_group_ids: [],
                user_custom_field_1: 'string',
                user_custom_field_2: 'string',
                user_custom_field_3: 'string',
                user_custom_field_4: 'string',
                user_custom_field_5: 'string',
                user_custom_field_6: 'string',
                user_custom_field_7: 'string',
                user_custom_field_8: 'string',
                user_custom_field_9: 'string',
                user_custom_field_10: 'string'
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/send_email',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                id: '1',
                language: 'en',
                adv_criteria: {
                  user_name: 'e',
                  user_operator_level_id: '0',
                  user_group_id: 1,
                  user_group_ids: [],
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string'
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/v2/send_email");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "id": "1",
              "language": "en",
              "adv_criteria": {
                "user_name": "e",
                "user_operator_level_id": "0",
                "user_group_id": 1,
                "user_group_ids": [],
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string"
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/send_email',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                id: '1',
                language: 'en',
                adv_criteria: {
                  user_name: 'e',
                  user_operator_level_id: '0',
                  user_group_id: 1,
                  user_group_ids: [],
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string'
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/send_email';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"id":"1","language":"en","adv_criteria":{"user_name":"e","user_operator_level_id":"0","user_group_id":1,"user_group_ids":[],"user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"id":"1","language":"en","adv_criteria":{"user_name":"e","user_operator_level_id":"0","user_group_id":1,"user_group_ids":[],"user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string"}}'
            };

            fetch('https://{baseurl}/api/v2/send_email', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/send_email",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "id": "1",
              "language": "en",
              "adv_criteria": {
                "user_name": "e",
                "user_operator_level_id": "0",
                "user_group_id": 1,
                "user_group_ids": [],
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/send_email");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/send_email", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/send_email"


            payload = {
                "id": "1",
                "language": "en",
                "adv_criteria": {
                    "user_name": "e",
                    "user_operator_level_id": "0",
                    "user_group_id": 1,
                    "user_group_ids": [],
                    "user_custom_field_1": "string",
                    "user_custom_field_2": "string",
                    "user_custom_field_3": "string",
                    "user_custom_field_4": "string",
                    "user_custom_field_5": "string",
                    "user_custom_field_6": "string",
                    "user_custom_field_7": "string",
                    "user_custom_field_8": "string",
                    "user_custom_field_9": "string",
                    "user_custom_field_10": "string"
                }
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/send_email")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/send_email",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/send_email');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"id":"1","language":"en","adv_criteria":{"user_name":"e","user_operator_level_id":"0","user_group_id":1,"user_group_ids":[],"user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"id":"1","language":"en","adv_criteria":{"user_name":"e","user_operator_level_id":"0","user_group_id":1,"user_group_ids":[],"user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string"}}');


            $request->setRequestUrl('https://{baseurl}/api/v2/send_email');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/send_email")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/send_email")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/send_email\"\n\n\tpayload := strings.NewReader(\"{\\\"id\\\":\\\"1\\\",\\\"language\\\":\\\"en\\\",\\\"adv_criteria\\\":{\\\"user_name\\\":\\\"e\\\",\\\"user_operator_level_id\\\":\\\"0\\\",\\\"user_group_id\\\":1,\\\"user_group_ids\\\":[],\\\"user_custom_field_1\\\":\\\"string\\\",\\\"user_custom_field_2\\\":\\\"string\\\",\\\"user_custom_field_3\\\":\\\"string\\\",\\\"user_custom_field_4\\\":\\\"string\\\",\\\"user_custom_field_5\\\":\\\"string\\\",\\\"user_custom_field_6\\\":\\\"string\\\",\\\"user_custom_field_7\\\":\\\"string\\\",\\\"user_custom_field_8\\\":\\\"string\\\",\\\"user_custom_field_9\\\":\\\"string\\\",\\\"user_custom_field_10\\\":\\\"string\\\"}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/send_email");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"id": @"1",
                                          @"language": @"en",
                                          @"adv_criteria": @{ @"user_name": @"e", @"user_operator_level_id": @"0", @"user_group_id": @1, @"user_group_ids": @[  ], @"user_custom_field_1": @"string", @"user_custom_field_2": @"string", @"user_custom_field_3": @"string", @"user_custom_field_4": @"string", @"user_custom_field_5": @"string", @"user_custom_field_6": @"string", @"user_custom_field_7": @"string", @"user_custom_field_8": @"string", @"user_custom_field_9": @"string", @"user_custom_field_10": @"string" } };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/send_email"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "id": "1",
              "language": "en",
              "adv_criteria": [
                "user_name": "e",
                "user_operator_level_id": "0",
                "user_group_id": 1,
                "user_group_ids": [],
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string"
              ]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/send_email")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/v2/send_email");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/send_email"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/send_email' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"id":"1","language":"en","adv_criteria":{"user_name":"e","user_operator_level_id":"0","user_group_id":1,"user_group_ids":[],"user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/send_email' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"id":"1","language":"en","adv_criteria":{"user_name":"e","user_operator_level_id":"0","user_group_id":1,"user_group_ids":[],"user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/send_email"


            payload <-
            "{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/send_email" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"id\":\"1\",\"language\":\"en\",\"adv_criteria\":{\"user_name\":\"e\",\"user_operator_level_id\":\"0\",\"user_group_id\":1,\"user_group_ids\":[],\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/send_email")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/user_groups:
    get:
      tags:
        - User Groups
      summary: List User Group
      operationId: listUserGroup
      description: This API is used to list all User Groups.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/user_groups \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/user_groups \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/user_groups
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/user_groups",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/user_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/user_groups");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/user_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/user_groups';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/user_groups', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/user_groups",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/user_groups");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/user_groups", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/user_groups"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/user_groups")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/user_groups",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/user_groups');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/user_groups');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/user_groups")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/user_groups")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/user_groups\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/user_groups");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/user_groups"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/user_groups")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/user_groups");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/user_groups"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/user_groups' -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/user_groups' -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/user_groups"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/user_groups" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/user_groups")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - User Groups
      summary: Create User Group
      operationId: createUserGroup
      description: |-
        This API is used to create a new User Group.


        **Note:**

        - User groups may be created in up to 8 levels.

        - Up to 48 characters may be entered for a user group name.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserGroupInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/user_groups \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"UserGroup":{"parent_id":{"id":1},"depth":1,"name":"TestDataXFer3"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"UserGroup":{"parent_id":{"id":1},"depth":1,"name":"TestDataXFer3"}}'
            |  \
              http POST https://{baseurl}/api/user_groups \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"UserGroup":{"parent_id":{"id":1},"depth":1,"name":"TestDataXFer3"}}' \
              --output-document \
              - https://{baseurl}/api/user_groups
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/user_groups",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({UserGroup: {parent_id: {id: 1}, depth: 1,
            name: 'TestDataXFer3'}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/user_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {UserGroup: {parent_id: {id: 1}, depth: 1, name: 'TestDataXFer3'}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/user_groups");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "UserGroup": {
                "parent_id": {
                  "id": 1
                },
                "depth": 1,
                "name": "TestDataXFer3"
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/user_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {UserGroup: {parent_id: {id: 1}, depth: 1, name: 'TestDataXFer3'}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/user_groups';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"UserGroup":{"parent_id":{"id":1},"depth":1,"name":"TestDataXFer3"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"UserGroup":{"parent_id":{"id":1},"depth":1,"name":"TestDataXFer3"}}'
            };

            fetch('https://{baseurl}/api/user_groups', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/user_groups",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "UserGroup": {
                "parent_id": {
                  "id": 1
                },
                "depth": 1,
                "name": "TestDataXFer3"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/user_groups");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/user_groups", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/user_groups"


            payload = {"UserGroup": {
                    "parent_id": {"id": 1},
                    "depth": 1,
                    "name": "TestDataXFer3"
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/user_groups")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/user_groups",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/user_groups');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"UserGroup":{"parent_id":{"id":1},"depth":1,"name":"TestDataXFer3"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"UserGroup":{"parent_id":{"id":1},"depth":1,"name":"TestDataXFer3"}}');


            $request->setRequestUrl('https://{baseurl}/api/user_groups');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/user_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/user_groups")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/user_groups\"\n\n\tpayload := strings.NewReader(\"{\\\"UserGroup\\\":{\\\"parent_id\\\":{\\\"id\\\":1},\\\"depth\\\":1,\\\"name\\\":\\\"TestDataXFer3\\\"}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/user_groups");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"UserGroup": @{ @"parent_id": @{
            @"id": @1 }, @"depth": @1, @"name": @"TestDataXFer3" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/user_groups"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["UserGroup": [
                "parent_id": ["id": 1],
                "depth": 1,
                "name": "TestDataXFer3"
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/user_groups")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/user_groups");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/user_groups"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/user_groups' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"UserGroup":{"parent_id":{"id":1},"depth":1,"name":"TestDataXFer3"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/user_groups' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"UserGroup":{"parent_id":{"id":1},"depth":1,"name":"TestDataXFer3"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/user_groups"


            payload <-
            "{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/user_groups" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"UserGroup\":{\"parent_id\":{\"id\":1},\"depth\":1,\"name\":\"TestDataXFer3\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/user_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - User Groups
      summary: Delete User Group
      operationId: deleteUserGroup
      description: This API is used to delete a User Group.
      parameters:
        - name: id
          in: query
          schema:
            type: integer
          description: Id of the User Group which will be deleted.
          example: 21436
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/user_groups?id=21436' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE 'https://{baseurl}/api/user_groups?id=21436' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/user_groups?id=21436'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/user_groups?id=21436",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/user_groups',
              qs: {id: '21436'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("DELETE", "https://{baseurl}/api/user_groups");

            req.query({
              "id": "21436"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/user_groups',
              params: {id: '21436'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/user_groups?id=21436';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/user_groups?id=21436', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/user_groups?id=21436",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/user_groups?id=21436");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/user_groups?id=21436",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/user_groups"


            querystring = {"id":"21436"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/user_groups?id=21436")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/user_groups?id=21436",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/user_groups');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => '21436'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/user_groups');
            $request->setRequestMethod('DELETE');
            $request->setQuery(new http\QueryString([
              'id' => '21436'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/user_groups?id=21436")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/user_groups?id=21436")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/user_groups?id=21436\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/user_groups?id=21436");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/user_groups?id=21436"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/user_groups?id=21436")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/user_groups?id=21436");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/user_groups?id=21436"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/user_groups?id=21436' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/user_groups?id=21436' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/user_groups"


            queryString <- list([ 'id' ] = "21436")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/user_groups?id=21436"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/user_groups?id=21436")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/user_groups/search:
    post:
      tags:
        - User Groups
      summary: Search User Groups by ID
      operationId: searchUserGroupsearch
      description: >-
        This API is used to list User Group(s) which are specified in the
        request body.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserGroupSearchInput'
      responses:
        '200':
          description: User Groups retrieved successfully
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/user_groups/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"user_group_id_list":["1004","21109"]}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"user_group_id_list":["1004","21109"]}' |  \
              http POST https://{baseurl}/api/v2/user_groups/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"user_group_id_list":["1004","21109"]}' \
              --output-document \
              - https://{baseurl}/api/v2/user_groups/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/user_groups/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({user_group_id_list: ['1004', '21109']}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/user_groups/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {user_group_id_list: ['1004', '21109']},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/user_groups/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "user_group_id_list": [
                "1004",
                "21109"
              ]
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/user_groups/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {user_group_id_list: ['1004', '21109']}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/user_groups/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"user_group_id_list":["1004","21109"]}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"user_group_id_list":["1004","21109"]}'
            };

            fetch('https://{baseurl}/api/v2/user_groups/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/user_groups/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"user_group_id_list\":[\"1004\",\"21109\"]}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "user_group_id_list": [
                "1004",
                "21109"
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/user_groups/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"user_group_id_list\":[\"1004\",\"21109\"]}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/user_groups/search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/user_groups/search"


            payload = {"user_group_id_list": ["1004", "21109"]}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/user_groups/search")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"user_group_id_list\":[\"1004\",\"21109\"]}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/user_groups/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"user_group_id_list\":[\"1004\",\"21109\"]}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/user_groups/search');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"user_group_id_list":["1004","21109"]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"user_group_id_list":["1004","21109"]}');


            $request->setRequestUrl('https://{baseurl}/api/v2/user_groups/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"user_group_id_list\":[\"1004\",\"21109\"]}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/user_groups/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/user_groups/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"user_group_id_list\":[\"1004\",\"21109\"]}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/user_groups/search\"\n\n\tpayload := strings.NewReader(\"{\\\"user_group_id_list\\\":[\\\"1004\\\",\\\"21109\\\"]}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/user_groups/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"user_group_id_list\":[\"1004\",\"21109\"]}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"user_group_id_list": @[ @"1004",
            @"21109" ] };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/user_groups/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["user_group_id_list": ["1004", "21109"]] as
            [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/user_groups/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/user_groups/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"user_group_id_list\":[\"1004\",\"21109\"]}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/user_groups/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"user_group_id_list\":[\"1004\",\"21109\"]}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/user_groups/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"user_group_id_list":["1004","21109"]}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/user_groups/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"user_group_id_list":["1004","21109"]}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/user_groups/search"


            payload <- "{\"user_group_id_list\":[\"1004\",\"21109\"]}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/user_groups/search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"user_group_id_list\":[\"1004\",\"21109\"]}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"user_group_id_list\":[\"1004\",\"21109\"]}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/user_groups/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/user_groups/{id}:
    put:
      tags:
        - User Groups
      summary: Update User Group
      operationId: updateUserGroup
      description: This API is used to update a User Group.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserGroupUpdateInput'
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the User Group which will be updated
          example: 21436
      responses:
        '200':
          description: User Group updated successfully
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/user_groups/21436 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"UserGroup":{"name":"TestDataXFer3xx"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"UserGroup":{"name":"TestDataXFer3xx"}}' |  \
              http PUT https://{baseurl}/api/user_groups/21436 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"UserGroup":{"name":"TestDataXFer3xx"}}' \
              --output-document \
              - https://{baseurl}/api/user_groups/21436
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/user_groups/21436",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({UserGroup: {name: 'TestDataXFer3xx'}}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/user_groups/21436',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {UserGroup: {name: 'TestDataXFer3xx'}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/user_groups/21436");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "UserGroup": {
                "name": "TestDataXFer3xx"
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/user_groups/21436',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {UserGroup: {name: 'TestDataXFer3xx'}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/user_groups/21436';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"UserGroup":{"name":"TestDataXFer3xx"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"UserGroup":{"name":"TestDataXFer3xx"}}'
            };

            fetch('https://{baseurl}/api/user_groups/21436', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/user_groups/21436",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "UserGroup": {
                "name": "TestDataXFer3xx"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/user_groups/21436");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/user_groups/21436", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/user_groups/21436"


            payload = {"UserGroup": {"name": "TestDataXFer3xx"}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/user_groups/21436")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Put.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/user_groups/21436",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/user_groups/21436');
            $request->setMethod(HTTP_METH_PUT);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"UserGroup":{"name":"TestDataXFer3xx"}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"UserGroup":{"name":"TestDataXFer3xx"}}');

            $request->setRequestUrl('https://{baseurl}/api/user_groups/21436');
            $request->setRequestMethod('PUT');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/user_groups/21436")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/user_groups/21436")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/user_groups/21436\"\n\n\tpayload := strings.NewReader(\"{\\\"UserGroup\\\":{\\\"name\\\":\\\"TestDataXFer3xx\\\"}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/user_groups/21436");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"UserGroup": @{ @"name":
            @"TestDataXFer3xx" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/user_groups/21436"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["UserGroup": ["name": "TestDataXFer3xx"]] as
            [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/user_groups/21436")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/user_groups/21436");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/user_groups/21436"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/user_groups/21436' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"UserGroup":{"name":"TestDataXFer3xx"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/user_groups/21436' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"UserGroup":{"name":"TestDataXFer3xx"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/user_groups/21436"


            payload <- "{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/user_groups/21436" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}" in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"UserGroup\":{\"name\":\"TestDataXFer3xx\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/user_groups/21436")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/setting/biostar:
    get:
      tags:
        - Create User
      summary: 02 View BioStar Settings
      operationId: getBiostar
      description: >-
        After logged in, use this API to view the User ID setting of the BioStar
        X, is it AlphaNumeric or Number.


        It can be seen on parameter `use_alphanumeric`, if the value is false
        then the current setting for User ID is Number, else it's AlphaNumeric.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/setting/biostar \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/setting/biostar \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/setting/biostar
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/biostar",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/setting/biostar',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/setting/biostar");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/setting/biostar',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/setting/biostar';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/setting/biostar', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/biostar",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/setting/biostar");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/setting/biostar",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/setting/biostar"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/setting/biostar")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/biostar",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/setting/biostar');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/setting/biostar');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/biostar")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/setting/biostar")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/biostar\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/biostar");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/biostar"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/biostar")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/biostar");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/setting/biostar"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/biostar' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/biostar' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/biostar"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/setting/biostar" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/biostar")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    put:
      tags:
        - Setting
      summary: Update BioStar X Settings
      operationId: updateBiostar
      description: This API is used to update various BioStar X settings.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                BioStar:
                  type: object
                  properties:
                    session_timeout:
                      type: string
                      description: >-
                        Set a session timeout period. If there is no activity on
                        BioStar X for the set time after logging in, the session
                        is logged out automatically. This value represents
                        second.
                    server_port:
                      type: string
                      description: Port number that BioStar X uses.
                    server_matching:
                      $ref: '#/components/schemas/ServerMatching'
                    user_sync_method:
                      type: integer
                      description: >-
                        Automatic user synchronization setting. Need to be
                        combined with `user_by_device_sync_method` to use.

                        - Not Used : `user_sync_method` : "0" &
                        `user_by_device_sync_method`:"0"

                        - All Devices : `user_sync_method` : "1" &
                        `user_by_device_sync_method`:"0"

                        - All Devices (Including user update from device) :
                        `user_sync_method` : "1" &
                        `user_by_device_sync_method`:"1"

                        - Specific Devices (Only devices belonging to the access
                        group) : `user_sync_method` : "3" &
                        `user_by_device_sync_method`:"0"
                    user_by_device_sync_method:
                      type: integer
                      description: See `user_sync_method`
                    log_sync_method:
                      type: integer
                      description: >-
                        Toggle value to 1 to set the Log Upload to manual, and 0
                        for automatic.
              example:
                BioStar:
                  session_timeout: '216000'
                  server_port: '51212'
                  server_matching:
                    matching-concurrency-count: 2
                    use-server-matching: false
                    security-level: 6
                    fast-mode: true
                    face-security-level: 1
                  user_sync_method: 1
                  user_by_device_sync_method: 0
                  log_sync_method: 0
                  check_duplicate_id_at_devices: 0
                  automatic_server_upgrade: 0
                  upgrade_when: 0
                  fingerprint_format: 0
                  licese_server_addr: http://license.biostar2.com
                  backup:
                    use: false
                    cycle: 2
                    day: 28
                    weekday: 2
                    time: 10800
                    path: .\bk
                    overwritable: 'false'
                  support_mobile_credential: 'true'
                  language: en
                  server_addr: ''
                  delete_credential_after_aoc: 'false'
                  secure_communication:
                    mode: '0'
                    use_external_cert: 'false'
                    enable_data_encryption: 'false'
                    enable_db_data_encryption: 'false'
                    ischanged_data_encryption: 'false'
                    ischanged_db_data_encryption: 'false'
                    enable_db_encryption: 'false'
                    is_random_encryption_key: 'true'
                    is_random_hash_key: 'true'
                    has_encryption_key: 'false'
                    has_hash_key: 'true'
                  system_security:
                    password_strength: '2'
                    use_password_update_cycle: 'false'
                    password_update_cycle: '60'
                    use_allow_login_failed: 'false'
                    allow_login_failed_count: '5'
                    allow_login_failed_minutes: '10'
                    use_allow_password_change: 'false'
                    allow_password_change_count: '1'
                    use_allow_simultaneous_connection: 'true'
                  web_request_timeout: '60'
                  imglog_dir: .\imagelog\
                  websocket_cors: '*'
                  enable_websocket_connection_bsSessionId: 'false'
                  enckey_dir: C:\Program Files\BioStar 2(x64)\util
                  device_event_log_skip_enroll_success_user: 'false'
                  http:
                    port: '80'
                    root_path: html
                  https:
                    use_ssl: '1'
                    port: '443'
                    ssl_addr: 192.168.1.5
                    server.ssl.key-store-password.use_enc: '1'
                  cloud:
                    use_cloud: '0'
                    server_address: api.biostar2.com
                    http_port: '52000'
                    version: v2
                    sub_domain: oddbit
                    email: team-suprema@oddbit.id
                    account_id: 611dcbe1f3e8e50a179b105c
                    email_use_enc: '1'
                  tna:
                    use_tna: 'true'
                    http_port: '3000'
                    https_port: '3002'
                    ngrok_port: '51000'
                  video:
                    use_video: 'true'
                    http_port: '3010'
                    https_port: '3012'
                    ngrok_port: '52002'
                  licenses:
                    - product_type: '1'
                      name: biostar_def
                      available:
                        ZONE: 'false'
                        ELEVATOR: 'false'
                        SERVER_MATCHING: 'false'
                        CLOUD: 'false'
                        MOBILE_CARD: 'false'
                        GRAPHICMAP: 'false'
                      activated: 'true'
                    - product_type: '2'
                      name: biostar_std
                      activated: 'false'
                    - product_type: '3'
                      name: biostar_tna
                      activated: 'false'
                    - product_type: '4'
                      name: biostar2_basic
                      activated: 'false'
                    - product_type: '5'
                      name: biostar2_std
                      activated: 'false'
                    - product_type: '6'
                      name: biostar2_adv
                      available:
                        ZONE: 'true'
                        ELEVATOR: 'true'
                        SERVER_MATCHING: 'true'
                        CLOUD: 'true'
                        MOBILE_CARD: 'true'
                        GRAPHICMAP: 'true'
                      activated: 'true'
                      customer: Oddbit
                      expires_on: permanent
                    - product_type: '7'
                      name: biostar2_pro
                      activated: 'false'
                    - product_type: '8'
                      name: biostar2_ent
                      activated: 'false'
                    - product_type: '9'
                      name: biostar2_video
                      activated: 'false'
                    - product_type: '10'
                      name: biostar2_visitor
                      activated: 'false'
                    - product_type: '11'
                      name: biostar2_tna_std
                      activated: 'false'
                    - product_type: '12'
                      name: biostar2_tna_adv
                      activated: 'false'
                    - product_type: '13'
                      name: biostar2_tna_pro
                      activated: 'false'
                  mobile:
                    use_mobile_credential: '1'
                    email: agni@supremainc.com
                    password: '****************'
                    mc_server_addr: https://api.mc.suprema.io
                    mc_port: '443'
                    siteid: '6482'
                    site_type: REGULAR
                  log_level:
                    enable: 'true'
                    log_retain_days: '60'
                    level: none
                    filter:
                      SYS: info
                      DBG: none
                      NET: info
                      WEB: info
                      SQL: none
                      WSS: none
                  server_ip_list:
                    - ip: 192.168.1.5
                      version: v4
                  use_alphanumeric: 'false'
                  is_set_new_administrator_password: 'false'
                  ischanged_db_data_encryption: 'false'
                  ischanged_data_encryption: 'false'
                  eventlog:
                    event_log_retain_days: '60'
                    active: 'false'
                  log:
                    log_retain_days: '60'
                    cron: 0 0 0 * * *
                    path: logs
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/setting/biostar \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"BioStar":{"session_timeout":"216000","server_port":"51212","server_matching":{"matching-concurrency-count":2,"use-server-matching":false,"security-level":6,"fast-mode":true,"face-security-level":1},"user_sync_method":1,"user_by_device_sync_method":0,"log_sync_method":0,"check_duplicate_id_at_devices":0,"automatic_server_upgrade":0,"upgrade_when":0,"fingerprint_format":0,"licese_server_addr":"http://license.biostar2.com","backup":{"use":false,"cycle":2,"day":28,"weekday":2,"time":10800,"path":".\\bk","overwritable":"false"},"support_mobile_credential":"true","language":"en","server_addr":"","delete_credential_after_aoc":"false","secure_communication":{"mode":"0","use_external_cert":"false","enable_data_encryption":"false","enable_db_data_encryption":"false","ischanged_data_encryption":"false","ischanged_db_data_encryption":"false","enable_db_encryption":"false","is_random_encryption_key":"true","is_random_hash_key":"true","has_encryption_key":"false","has_hash_key":"true"},"system_security":{"password_strength":"2","use_password_update_cycle":"false","password_update_cycle":"60","use_allow_login_failed":"false","allow_login_failed_count":"5","allow_login_failed_minutes":"10","use_allow_password_change":"false","allow_password_change_count":"1","use_allow_simultaneous_connection":"true"},"web_request_timeout":"60","imglog_dir":".\\imagelog\\","websocket_cors":"*","enable_websocket_connection_bsSessionId":"false","enckey_dir":"C:\\Program Files\\BioStar 2(x64)\\util","device_event_log_skip_enroll_success_user":"false","http":{"port":"80","root_path":"html"},"https":{"use_ssl":"1","port":"443","ssl_addr":"192.168.1.5","server.ssl.key-store-password.use_enc":"1"},"cloud":{"use_cloud":"0","server_address":"api.biostar2.com","http_port":"52000","version":"v2","sub_domain":"oddbit","email":"team-suprema@oddbit.id","account_id":"611dcbe1f3e8e50a179b105c","email_use_enc":"1"},"tna":{"use_tna":"true","http_port":"3000","https_port":"3002","ngrok_port":"51000"},"video":{"use_video":"true","http_port":"3010","https_port":"3012","ngrok_port":"52002"},"licenses":[{"product_type":"1","name":"biostar_def","available":{"ZONE":"false","ELEVATOR":"false","SERVER_MATCHING":"false","CLOUD":"false","MOBILE_CARD":"false","GRAPHICMAP":"false"},"activated":"true"},{"product_type":"2","name":"biostar_std","activated":"false"},{"product_type":"3","name":"biostar_tna","activated":"false"},{"product_type":"4","name":"biostar2_basic","activated":"false"},{"product_type":"5","name":"biostar2_std","activated":"false"},{"product_type":"6","name":"biostar2_adv","available":{"ZONE":"true","ELEVATOR":"true","SERVER_MATCHING":"true","CLOUD":"true","MOBILE_CARD":"true","GRAPHICMAP":"true"},"activated":"true","customer":"Oddbit","expires_on":"permanent"},{"product_type":"7","name":"biostar2_pro","activated":"false"},{"product_type":"8","name":"biostar2_ent","activated":"false"},{"product_type":"9","name":"biostar2_video","activated":"false"},{"product_type":"10","name":"biostar2_visitor","activated":"false"},{"product_type":"11","name":"biostar2_tna_std","activated":"false"},{"product_type":"12","name":"biostar2_tna_adv","activated":"false"},{"product_type":"13","name":"biostar2_tna_pro","activated":"false"}],"mobile":{"use_mobile_credential":"1","email":"agni@supremainc.com","password":"****************","mc_server_addr":"https://api.mc.suprema.io","mc_port":"443","siteid":"6482","site_type":"REGULAR"},"log_level":{"enable":"true","log_retain_days":"60","level":"none","filter":{"SYS":"info","DBG":"none","NET":"info","WEB":"info","SQL":"none","WSS":"none"}},"server_ip_list":[{"ip":"192.168.1.5","version":"v4"}],"use_alphanumeric":"false","is_set_new_administrator_password":"false","ischanged_db_data_encryption":"false","ischanged_data_encryption":"false","eventlog":{"event_log_retain_days":"60","active":"false"},"log":{"log_retain_days":"60","cron":"0 0 0 * * *","path":"logs"}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"BioStar":{"session_timeout":"216000","server_port":"51212","server_matching":{"matching-concurrency-count":2,"use-server-matching":false,"security-level":6,"fast-mode":true,"face-security-level":1},"user_sync_method":1,"user_by_device_sync_method":0,"log_sync_method":0,"check_duplicate_id_at_devices":0,"automatic_server_upgrade":0,"upgrade_when":0,"fingerprint_format":0,"licese_server_addr":"http://license.biostar2.com","backup":{"use":false,"cycle":2,"day":28,"weekday":2,"time":10800,"path":".\\bk","overwritable":"false"},"support_mobile_credential":"true","language":"en","server_addr":"","delete_credential_after_aoc":"false","secure_communication":{"mode":"0","use_external_cert":"false","enable_data_encryption":"false","enable_db_data_encryption":"false","ischanged_data_encryption":"false","ischanged_db_data_encryption":"false","enable_db_encryption":"false","is_random_encryption_key":"true","is_random_hash_key":"true","has_encryption_key":"false","has_hash_key":"true"},"system_security":{"password_strength":"2","use_password_update_cycle":"false","password_update_cycle":"60","use_allow_login_failed":"false","allow_login_failed_count":"5","allow_login_failed_minutes":"10","use_allow_password_change":"false","allow_password_change_count":"1","use_allow_simultaneous_connection":"true"},"web_request_timeout":"60","imglog_dir":".\\imagelog\\","websocket_cors":"*","enable_websocket_connection_bsSessionId":"false","enckey_dir":"C:\\Program
            Files\\BioStar
            2(x64)\\util","device_event_log_skip_enroll_success_user":"false","http":{"port":"80","root_path":"html"},"https":{"use_ssl":"1","port":"443","ssl_addr":"192.168.1.5","server.ssl.key-store-password.use_enc":"1"},"cloud":{"use_cloud":"0","server_address":"api.biostar2.com","http_port":"52000","version":"v2","sub_domain":"oddbit","email":"team-suprema@oddbit.id","account_id":"611dcbe1f3e8e50a179b105c","email_use_enc":"1"},"tna":{"use_tna":"true","http_port":"3000","https_port":"3002","ngrok_port":"51000"},"video":{"use_video":"true","http_port":"3010","https_port":"3012","ngrok_port":"52002"},"licenses":[{"product_type":"1","name":"biostar_def","available":{"ZONE":"false","ELEVATOR":"false","SERVER_MATCHING":"false","CLOUD":"false","MOBILE_CARD":"false","GRAPHICMAP":"false"},"activated":"true"},{"product_type":"2","name":"biostar_std","activated":"false"},{"product_type":"3","name":"biostar_tna","activated":"false"},{"product_type":"4","name":"biostar2_basic","activated":"false"},{"product_type":"5","name":"biostar2_std","activated":"false"},{"product_type":"6","name":"biostar2_adv","available":{"ZONE":"true","ELEVATOR":"true","SERVER_MATCHING":"true","CLOUD":"true","MOBILE_CARD":"true","GRAPHICMAP":"true"},"activated":"true","customer":"Oddbit","expires_on":"permanent"},{"product_type":"7","name":"biostar2_pro","activated":"false"},{"product_type":"8","name":"biostar2_ent","activated":"false"},{"product_type":"9","name":"biostar2_video","activated":"false"},{"product_type":"10","name":"biostar2_visitor","activated":"false"},{"product_type":"11","name":"biostar2_tna_std","activated":"false"},{"product_type":"12","name":"biostar2_tna_adv","activated":"false"},{"product_type":"13","name":"biostar2_tna_pro","activated":"false"}],"mobile":{"use_mobile_credential":"1","email":"agni@supremainc.com","password":"****************","mc_server_addr":"https://api.mc.suprema.io","mc_port":"443","siteid":"6482","site_type":"REGULAR"},"log_level":{"enable":"true","log_retain_days":"60","level":"none","filter":{"SYS":"info","DBG":"none","NET":"info","WEB":"info","SQL":"none","WSS":"none"}},"server_ip_list":[{"ip":"192.168.1.5","version":"v4"}],"use_alphanumeric":"false","is_set_new_administrator_password":"false","ischanged_db_data_encryption":"false","ischanged_data_encryption":"false","eventlog":{"event_log_retain_days":"60","active":"false"},"log":{"log_retain_days":"60","cron":"0
            0 0 * * *","path":"logs"}}}' |  \
              http PUT https://{baseurl}/api/setting/biostar \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"BioStar":{"session_timeout":"216000","server_port":"51212","server_matching":{"matching-concurrency-count":2,"use-server-matching":false,"security-level":6,"fast-mode":true,"face-security-level":1},"user_sync_method":1,"user_by_device_sync_method":0,"log_sync_method":0,"check_duplicate_id_at_devices":0,"automatic_server_upgrade":0,"upgrade_when":0,"fingerprint_format":0,"licese_server_addr":"http://license.biostar2.com","backup":{"use":false,"cycle":2,"day":28,"weekday":2,"time":10800,"path":".\\bk","overwritable":"false"},"support_mobile_credential":"true","language":"en","server_addr":"","delete_credential_after_aoc":"false","secure_communication":{"mode":"0","use_external_cert":"false","enable_data_encryption":"false","enable_db_data_encryption":"false","ischanged_data_encryption":"false","ischanged_db_data_encryption":"false","enable_db_encryption":"false","is_random_encryption_key":"true","is_random_hash_key":"true","has_encryption_key":"false","has_hash_key":"true"},"system_security":{"password_strength":"2","use_password_update_cycle":"false","password_update_cycle":"60","use_allow_login_failed":"false","allow_login_failed_count":"5","allow_login_failed_minutes":"10","use_allow_password_change":"false","allow_password_change_count":"1","use_allow_simultaneous_connection":"true"},"web_request_timeout":"60","imglog_dir":".\\imagelog\\","websocket_cors":"*","enable_websocket_connection_bsSessionId":"false","enckey_dir":"C:\\Program Files\\BioStar 2(x64)\\util","device_event_log_skip_enroll_success_user":"false","http":{"port":"80","root_path":"html"},"https":{"use_ssl":"1","port":"443","ssl_addr":"192.168.1.5","server.ssl.key-store-password.use_enc":"1"},"cloud":{"use_cloud":"0","server_address":"api.biostar2.com","http_port":"52000","version":"v2","sub_domain":"oddbit","email":"team-suprema@oddbit.id","account_id":"611dcbe1f3e8e50a179b105c","email_use_enc":"1"},"tna":{"use_tna":"true","http_port":"3000","https_port":"3002","ngrok_port":"51000"},"video":{"use_video":"true","http_port":"3010","https_port":"3012","ngrok_port":"52002"},"licenses":[{"product_type":"1","name":"biostar_def","available":{"ZONE":"false","ELEVATOR":"false","SERVER_MATCHING":"false","CLOUD":"false","MOBILE_CARD":"false","GRAPHICMAP":"false"},"activated":"true"},{"product_type":"2","name":"biostar_std","activated":"false"},{"product_type":"3","name":"biostar_tna","activated":"false"},{"product_type":"4","name":"biostar2_basic","activated":"false"},{"product_type":"5","name":"biostar2_std","activated":"false"},{"product_type":"6","name":"biostar2_adv","available":{"ZONE":"true","ELEVATOR":"true","SERVER_MATCHING":"true","CLOUD":"true","MOBILE_CARD":"true","GRAPHICMAP":"true"},"activated":"true","customer":"Oddbit","expires_on":"permanent"},{"product_type":"7","name":"biostar2_pro","activated":"false"},{"product_type":"8","name":"biostar2_ent","activated":"false"},{"product_type":"9","name":"biostar2_video","activated":"false"},{"product_type":"10","name":"biostar2_visitor","activated":"false"},{"product_type":"11","name":"biostar2_tna_std","activated":"false"},{"product_type":"12","name":"biostar2_tna_adv","activated":"false"},{"product_type":"13","name":"biostar2_tna_pro","activated":"false"}],"mobile":{"use_mobile_credential":"1","email":"agni@supremainc.com","password":"****************","mc_server_addr":"https://api.mc.suprema.io","mc_port":"443","siteid":"6482","site_type":"REGULAR"},"log_level":{"enable":"true","log_retain_days":"60","level":"none","filter":{"SYS":"info","DBG":"none","NET":"info","WEB":"info","SQL":"none","WSS":"none"}},"server_ip_list":[{"ip":"192.168.1.5","version":"v4"}],"use_alphanumeric":"false","is_set_new_administrator_password":"false","ischanged_db_data_encryption":"false","ischanged_data_encryption":"false","eventlog":{"event_log_retain_days":"60","active":"false"},"log":{"log_retain_days":"60","cron":"0 0 0 * * *","path":"logs"}}}' \
              --output-document \
              - https://{baseurl}/api/setting/biostar
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/biostar",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              BioStar: {
                session_timeout: '216000',
                server_port: '51212',
                server_matching: {
                  'matching-concurrency-count': 2,
                  'use-server-matching': false,
                  'security-level': 6,
                  'fast-mode': true,
                  'face-security-level': 1
                },
                user_sync_method: 1,
                user_by_device_sync_method: 0,
                log_sync_method: 0,
                check_duplicate_id_at_devices: 0,
                automatic_server_upgrade: 0,
                upgrade_when: 0,
                fingerprint_format: 0,
                licese_server_addr: 'http://license.biostar2.com',
                backup: {
                  use: false,
                  cycle: 2,
                  day: 28,
                  weekday: 2,
                  time: 10800,
                  path: '.\bk',
                  overwritable: 'false'
                },
                support_mobile_credential: 'true',
                language: 'en',
                server_addr: '',
                delete_credential_after_aoc: 'false',
                secure_communication: {
                  mode: '0',
                  use_external_cert: 'false',
                  enable_data_encryption: 'false',
                  enable_db_data_encryption: 'false',
                  ischanged_data_encryption: 'false',
                  ischanged_db_data_encryption: 'false',
                  enable_db_encryption: 'false',
                  is_random_encryption_key: 'true',
                  is_random_hash_key: 'true',
                  has_encryption_key: 'false',
                  has_hash_key: 'true'
                },
                system_security: {
                  password_strength: '2',
                  use_password_update_cycle: 'false',
                  password_update_cycle: '60',
                  use_allow_login_failed: 'false',
                  allow_login_failed_count: '5',
                  allow_login_failed_minutes: '10',
                  use_allow_password_change: 'false',
                  allow_password_change_count: '1',
                  use_allow_simultaneous_connection: 'true'
                },
                web_request_timeout: '60',
                imglog_dir: '.\imagelog\',
                websocket_cors: '*',
                enable_websocket_connection_bsSessionId: 'false',
                enckey_dir: 'C:\Program Files\BioStar 2(x64)\util',
                device_event_log_skip_enroll_success_user: 'false',
                http: {port: '80', root_path: 'html'},
                https: {
                  use_ssl: '1',
                  port: '443',
                  ssl_addr: '192.168.1.5',
                  'server.ssl.key-store-password.use_enc': '1'
                },
                cloud: {
                  use_cloud: '0',
                  server_address: 'api.biostar2.com',
                  http_port: '52000',
                  version: 'v2',
                  sub_domain: 'oddbit',
                  email: 'team-suprema@oddbit.id',
                  account_id: '611dcbe1f3e8e50a179b105c',
                  email_use_enc: '1'
                },
                tna: {use_tna: 'true', http_port: '3000', https_port: '3002', ngrok_port: '51000'},
                video: {use_video: 'true', http_port: '3010', https_port: '3012', ngrok_port: '52002'},
                licenses: [
                  {
                    product_type: '1',
                    name: 'biostar_def',
                    available: {
                      ZONE: 'false',
                      ELEVATOR: 'false',
                      SERVER_MATCHING: 'false',
                      CLOUD: 'false',
                      MOBILE_CARD: 'false',
                      GRAPHICMAP: 'false'
                    },
                    activated: 'true'
                  },
                  {product_type: '2', name: 'biostar_std', activated: 'false'},
                  {product_type: '3', name: 'biostar_tna', activated: 'false'},
                  {product_type: '4', name: 'biostar2_basic', activated: 'false'},
                  {product_type: '5', name: 'biostar2_std', activated: 'false'},
                  {
                    product_type: '6',
                    name: 'biostar2_adv',
                    available: {
                      ZONE: 'true',
                      ELEVATOR: 'true',
                      SERVER_MATCHING: 'true',
                      CLOUD: 'true',
                      MOBILE_CARD: 'true',
                      GRAPHICMAP: 'true'
                    },
                    activated: 'true',
                    customer: 'Oddbit',
                    expires_on: 'permanent'
                  },
                  {product_type: '7', name: 'biostar2_pro', activated: 'false'},
                  {product_type: '8', name: 'biostar2_ent', activated: 'false'},
                  {product_type: '9', name: 'biostar2_video', activated: 'false'},
                  {product_type: '10', name: 'biostar2_visitor', activated: 'false'},
                  {product_type: '11', name: 'biostar2_tna_std', activated: 'false'},
                  {product_type: '12', name: 'biostar2_tna_adv', activated: 'false'},
                  {product_type: '13', name: 'biostar2_tna_pro', activated: 'false'}
                ],
                mobile: {
                  use_mobile_credential: '1',
                  email: 'agni@supremainc.com',
                  password: '****************',
                  mc_server_addr: 'https://api.mc.suprema.io',
                  mc_port: '443',
                  siteid: '6482',
                  site_type: 'REGULAR'
                },
                log_level: {
                  enable: 'true',
                  log_retain_days: '60',
                  level: 'none',
                  filter: {SYS: 'info', DBG: 'none', NET: 'info', WEB: 'info', SQL: 'none', WSS: 'none'}
                },
                server_ip_list: [{ip: '192.168.1.5', version: 'v4'}],
                use_alphanumeric: 'false',
                is_set_new_administrator_password: 'false',
                ischanged_db_data_encryption: 'false',
                ischanged_data_encryption: 'false',
                eventlog: {event_log_retain_days: '60', active: 'false'},
                log: {log_retain_days: '60', cron: '0 0 0 * * *', path: 'logs'}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting/biostar',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                BioStar: {
                  session_timeout: '216000',
                  server_port: '51212',
                  server_matching: {
                    'matching-concurrency-count': 2,
                    'use-server-matching': false,
                    'security-level': 6,
                    'fast-mode': true,
                    'face-security-level': 1
                  },
                  user_sync_method: 1,
                  user_by_device_sync_method: 0,
                  log_sync_method: 0,
                  check_duplicate_id_at_devices: 0,
                  automatic_server_upgrade: 0,
                  upgrade_when: 0,
                  fingerprint_format: 0,
                  licese_server_addr: 'http://license.biostar2.com',
                  backup: {
                    use: false,
                    cycle: 2,
                    day: 28,
                    weekday: 2,
                    time: 10800,
                    path: '.\bk',
                    overwritable: 'false'
                  },
                  support_mobile_credential: 'true',
                  language: 'en',
                  server_addr: '',
                  delete_credential_after_aoc: 'false',
                  secure_communication: {
                    mode: '0',
                    use_external_cert: 'false',
                    enable_data_encryption: 'false',
                    enable_db_data_encryption: 'false',
                    ischanged_data_encryption: 'false',
                    ischanged_db_data_encryption: 'false',
                    enable_db_encryption: 'false',
                    is_random_encryption_key: 'true',
                    is_random_hash_key: 'true',
                    has_encryption_key: 'false',
                    has_hash_key: 'true'
                  },
                  system_security: {
                    password_strength: '2',
                    use_password_update_cycle: 'false',
                    password_update_cycle: '60',
                    use_allow_login_failed: 'false',
                    allow_login_failed_count: '5',
                    allow_login_failed_minutes: '10',
                    use_allow_password_change: 'false',
                    allow_password_change_count: '1',
                    use_allow_simultaneous_connection: 'true'
                  },
                  web_request_timeout: '60',
                  imglog_dir: '.\imagelog\',
                  websocket_cors: '*',
                  enable_websocket_connection_bsSessionId: 'false',
                  enckey_dir: 'C:\Program Files\BioStar 2(x64)\util',
                  device_event_log_skip_enroll_success_user: 'false',
                  http: {port: '80', root_path: 'html'},
                  https: {
                    use_ssl: '1',
                    port: '443',
                    ssl_addr: '192.168.1.5',
                    'server.ssl.key-store-password.use_enc': '1'
                  },
                  cloud: {
                    use_cloud: '0',
                    server_address: 'api.biostar2.com',
                    http_port: '52000',
                    version: 'v2',
                    sub_domain: 'oddbit',
                    email: 'team-suprema@oddbit.id',
                    account_id: '611dcbe1f3e8e50a179b105c',
                    email_use_enc: '1'
                  },
                  tna: {use_tna: 'true', http_port: '3000', https_port: '3002', ngrok_port: '51000'},
                  video: {use_video: 'true', http_port: '3010', https_port: '3012', ngrok_port: '52002'},
                  licenses: [
                    {
                      product_type: '1',
                      name: 'biostar_def',
                      available: {
                        ZONE: 'false',
                        ELEVATOR: 'false',
                        SERVER_MATCHING: 'false',
                        CLOUD: 'false',
                        MOBILE_CARD: 'false',
                        GRAPHICMAP: 'false'
                      },
                      activated: 'true'
                    },
                    {product_type: '2', name: 'biostar_std', activated: 'false'},
                    {product_type: '3', name: 'biostar_tna', activated: 'false'},
                    {product_type: '4', name: 'biostar2_basic', activated: 'false'},
                    {product_type: '5', name: 'biostar2_std', activated: 'false'},
                    {
                      product_type: '6',
                      name: 'biostar2_adv',
                      available: {
                        ZONE: 'true',
                        ELEVATOR: 'true',
                        SERVER_MATCHING: 'true',
                        CLOUD: 'true',
                        MOBILE_CARD: 'true',
                        GRAPHICMAP: 'true'
                      },
                      activated: 'true',
                      customer: 'Oddbit',
                      expires_on: 'permanent'
                    },
                    {product_type: '7', name: 'biostar2_pro', activated: 'false'},
                    {product_type: '8', name: 'biostar2_ent', activated: 'false'},
                    {product_type: '9', name: 'biostar2_video', activated: 'false'},
                    {product_type: '10', name: 'biostar2_visitor', activated: 'false'},
                    {product_type: '11', name: 'biostar2_tna_std', activated: 'false'},
                    {product_type: '12', name: 'biostar2_tna_adv', activated: 'false'},
                    {product_type: '13', name: 'biostar2_tna_pro', activated: 'false'}
                  ],
                  mobile: {
                    use_mobile_credential: '1',
                    email: 'agni@supremainc.com',
                    password: '****************',
                    mc_server_addr: 'https://api.mc.suprema.io',
                    mc_port: '443',
                    siteid: '6482',
                    site_type: 'REGULAR'
                  },
                  log_level: {
                    enable: 'true',
                    log_retain_days: '60',
                    level: 'none',
                    filter: {SYS: 'info', DBG: 'none', NET: 'info', WEB: 'info', SQL: 'none', WSS: 'none'}
                  },
                  server_ip_list: [{ip: '192.168.1.5', version: 'v4'}],
                  use_alphanumeric: 'false',
                  is_set_new_administrator_password: 'false',
                  ischanged_db_data_encryption: 'false',
                  ischanged_data_encryption: 'false',
                  eventlog: {event_log_retain_days: '60', active: 'false'},
                  log: {log_retain_days: '60', cron: '0 0 0 * * *', path: 'logs'}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/setting/biostar");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "BioStar": {
                "session_timeout": "216000",
                "server_port": "51212",
                "server_matching": {
                  "matching-concurrency-count": 2,
                  "use-server-matching": false,
                  "security-level": 6,
                  "fast-mode": true,
                  "face-security-level": 1
                },
                "user_sync_method": 1,
                "user_by_device_sync_method": 0,
                "log_sync_method": 0,
                "check_duplicate_id_at_devices": 0,
                "automatic_server_upgrade": 0,
                "upgrade_when": 0,
                "fingerprint_format": 0,
                "licese_server_addr": "http://license.biostar2.com",
                "backup": {
                  "use": false,
                  "cycle": 2,
                  "day": 28,
                  "weekday": 2,
                  "time": 10800,
                  "path": ".\\bk",
                  "overwritable": "false"
                },
                "support_mobile_credential": "true",
                "language": "en",
                "server_addr": "",
                "delete_credential_after_aoc": "false",
                "secure_communication": {
                  "mode": "0",
                  "use_external_cert": "false",
                  "enable_data_encryption": "false",
                  "enable_db_data_encryption": "false",
                  "ischanged_data_encryption": "false",
                  "ischanged_db_data_encryption": "false",
                  "enable_db_encryption": "false",
                  "is_random_encryption_key": "true",
                  "is_random_hash_key": "true",
                  "has_encryption_key": "false",
                  "has_hash_key": "true"
                },
                "system_security": {
                  "password_strength": "2",
                  "use_password_update_cycle": "false",
                  "password_update_cycle": "60",
                  "use_allow_login_failed": "false",
                  "allow_login_failed_count": "5",
                  "allow_login_failed_minutes": "10",
                  "use_allow_password_change": "false",
                  "allow_password_change_count": "1",
                  "use_allow_simultaneous_connection": "true"
                },
                "web_request_timeout": "60",
                "imglog_dir": ".\\imagelog\\",
                "websocket_cors": "*",
                "enable_websocket_connection_bsSessionId": "false",
                "enckey_dir": "C:\\Program Files\\BioStar 2(x64)\\util",
                "device_event_log_skip_enroll_success_user": "false",
                "http": {
                  "port": "80",
                  "root_path": "html"
                },
                "https": {
                  "use_ssl": "1",
                  "port": "443",
                  "ssl_addr": "192.168.1.5",
                  "server.ssl.key-store-password.use_enc": "1"
                },
                "cloud": {
                  "use_cloud": "0",
                  "server_address": "api.biostar2.com",
                  "http_port": "52000",
                  "version": "v2",
                  "sub_domain": "oddbit",
                  "email": "team-suprema@oddbit.id",
                  "account_id": "611dcbe1f3e8e50a179b105c",
                  "email_use_enc": "1"
                },
                "tna": {
                  "use_tna": "true",
                  "http_port": "3000",
                  "https_port": "3002",
                  "ngrok_port": "51000"
                },
                "video": {
                  "use_video": "true",
                  "http_port": "3010",
                  "https_port": "3012",
                  "ngrok_port": "52002"
                },
                "licenses": [
                  {
                    "product_type": "1",
                    "name": "biostar_def",
                    "available": {
                      "ZONE": "false",
                      "ELEVATOR": "false",
                      "SERVER_MATCHING": "false",
                      "CLOUD": "false",
                      "MOBILE_CARD": "false",
                      "GRAPHICMAP": "false"
                    },
                    "activated": "true"
                  },
                  {
                    "product_type": "2",
                    "name": "biostar_std",
                    "activated": "false"
                  },
                  {
                    "product_type": "3",
                    "name": "biostar_tna",
                    "activated": "false"
                  },
                  {
                    "product_type": "4",
                    "name": "biostar2_basic",
                    "activated": "false"
                  },
                  {
                    "product_type": "5",
                    "name": "biostar2_std",
                    "activated": "false"
                  },
                  {
                    "product_type": "6",
                    "name": "biostar2_adv",
                    "available": {
                      "ZONE": "true",
                      "ELEVATOR": "true",
                      "SERVER_MATCHING": "true",
                      "CLOUD": "true",
                      "MOBILE_CARD": "true",
                      "GRAPHICMAP": "true"
                    },
                    "activated": "true",
                    "customer": "Oddbit",
                    "expires_on": "permanent"
                  },
                  {
                    "product_type": "7",
                    "name": "biostar2_pro",
                    "activated": "false"
                  },
                  {
                    "product_type": "8",
                    "name": "biostar2_ent",
                    "activated": "false"
                  },
                  {
                    "product_type": "9",
                    "name": "biostar2_video",
                    "activated": "false"
                  },
                  {
                    "product_type": "10",
                    "name": "biostar2_visitor",
                    "activated": "false"
                  },
                  {
                    "product_type": "11",
                    "name": "biostar2_tna_std",
                    "activated": "false"
                  },
                  {
                    "product_type": "12",
                    "name": "biostar2_tna_adv",
                    "activated": "false"
                  },
                  {
                    "product_type": "13",
                    "name": "biostar2_tna_pro",
                    "activated": "false"
                  }
                ],
                "mobile": {
                  "use_mobile_credential": "1",
                  "email": "agni@supremainc.com",
                  "password": "****************",
                  "mc_server_addr": "https://api.mc.suprema.io",
                  "mc_port": "443",
                  "siteid": "6482",
                  "site_type": "REGULAR"
                },
                "log_level": {
                  "enable": "true",
                  "log_retain_days": "60",
                  "level": "none",
                  "filter": {
                    "SYS": "info",
                    "DBG": "none",
                    "NET": "info",
                    "WEB": "info",
                    "SQL": "none",
                    "WSS": "none"
                  }
                },
                "server_ip_list": [
                  {
                    "ip": "192.168.1.5",
                    "version": "v4"
                  }
                ],
                "use_alphanumeric": "false",
                "is_set_new_administrator_password": "false",
                "ischanged_db_data_encryption": "false",
                "ischanged_data_encryption": "false",
                "eventlog": {
                  "event_log_retain_days": "60",
                  "active": "false"
                },
                "log": {
                  "log_retain_days": "60",
                  "cron": "0 0 0 * * *",
                  "path": "logs"
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting/biostar',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                BioStar: {
                  session_timeout: '216000',
                  server_port: '51212',
                  server_matching: {
                    'matching-concurrency-count': 2,
                    'use-server-matching': false,
                    'security-level': 6,
                    'fast-mode': true,
                    'face-security-level': 1
                  },
                  user_sync_method: 1,
                  user_by_device_sync_method: 0,
                  log_sync_method: 0,
                  check_duplicate_id_at_devices: 0,
                  automatic_server_upgrade: 0,
                  upgrade_when: 0,
                  fingerprint_format: 0,
                  licese_server_addr: 'http://license.biostar2.com',
                  backup: {
                    use: false,
                    cycle: 2,
                    day: 28,
                    weekday: 2,
                    time: 10800,
                    path: '.\bk',
                    overwritable: 'false'
                  },
                  support_mobile_credential: 'true',
                  language: 'en',
                  server_addr: '',
                  delete_credential_after_aoc: 'false',
                  secure_communication: {
                    mode: '0',
                    use_external_cert: 'false',
                    enable_data_encryption: 'false',
                    enable_db_data_encryption: 'false',
                    ischanged_data_encryption: 'false',
                    ischanged_db_data_encryption: 'false',
                    enable_db_encryption: 'false',
                    is_random_encryption_key: 'true',
                    is_random_hash_key: 'true',
                    has_encryption_key: 'false',
                    has_hash_key: 'true'
                  },
                  system_security: {
                    password_strength: '2',
                    use_password_update_cycle: 'false',
                    password_update_cycle: '60',
                    use_allow_login_failed: 'false',
                    allow_login_failed_count: '5',
                    allow_login_failed_minutes: '10',
                    use_allow_password_change: 'false',
                    allow_password_change_count: '1',
                    use_allow_simultaneous_connection: 'true'
                  },
                  web_request_timeout: '60',
                  imglog_dir: '.\imagelog\',
                  websocket_cors: '*',
                  enable_websocket_connection_bsSessionId: 'false',
                  enckey_dir: 'C:\Program Files\BioStar 2(x64)\util',
                  device_event_log_skip_enroll_success_user: 'false',
                  http: {port: '80', root_path: 'html'},
                  https: {
                    use_ssl: '1',
                    port: '443',
                    ssl_addr: '192.168.1.5',
                    'server.ssl.key-store-password.use_enc': '1'
                  },
                  cloud: {
                    use_cloud: '0',
                    server_address: 'api.biostar2.com',
                    http_port: '52000',
                    version: 'v2',
                    sub_domain: 'oddbit',
                    email: 'team-suprema@oddbit.id',
                    account_id: '611dcbe1f3e8e50a179b105c',
                    email_use_enc: '1'
                  },
                  tna: {use_tna: 'true', http_port: '3000', https_port: '3002', ngrok_port: '51000'},
                  video: {use_video: 'true', http_port: '3010', https_port: '3012', ngrok_port: '52002'},
                  licenses: [
                    {
                      product_type: '1',
                      name: 'biostar_def',
                      available: {
                        ZONE: 'false',
                        ELEVATOR: 'false',
                        SERVER_MATCHING: 'false',
                        CLOUD: 'false',
                        MOBILE_CARD: 'false',
                        GRAPHICMAP: 'false'
                      },
                      activated: 'true'
                    },
                    {product_type: '2', name: 'biostar_std', activated: 'false'},
                    {product_type: '3', name: 'biostar_tna', activated: 'false'},
                    {product_type: '4', name: 'biostar2_basic', activated: 'false'},
                    {product_type: '5', name: 'biostar2_std', activated: 'false'},
                    {
                      product_type: '6',
                      name: 'biostar2_adv',
                      available: {
                        ZONE: 'true',
                        ELEVATOR: 'true',
                        SERVER_MATCHING: 'true',
                        CLOUD: 'true',
                        MOBILE_CARD: 'true',
                        GRAPHICMAP: 'true'
                      },
                      activated: 'true',
                      customer: 'Oddbit',
                      expires_on: 'permanent'
                    },
                    {product_type: '7', name: 'biostar2_pro', activated: 'false'},
                    {product_type: '8', name: 'biostar2_ent', activated: 'false'},
                    {product_type: '9', name: 'biostar2_video', activated: 'false'},
                    {product_type: '10', name: 'biostar2_visitor', activated: 'false'},
                    {product_type: '11', name: 'biostar2_tna_std', activated: 'false'},
                    {product_type: '12', name: 'biostar2_tna_adv', activated: 'false'},
                    {product_type: '13', name: 'biostar2_tna_pro', activated: 'false'}
                  ],
                  mobile: {
                    use_mobile_credential: '1',
                    email: 'agni@supremainc.com',
                    password: '****************',
                    mc_server_addr: 'https://api.mc.suprema.io',
                    mc_port: '443',
                    siteid: '6482',
                    site_type: 'REGULAR'
                  },
                  log_level: {
                    enable: 'true',
                    log_retain_days: '60',
                    level: 'none',
                    filter: {SYS: 'info', DBG: 'none', NET: 'info', WEB: 'info', SQL: 'none', WSS: 'none'}
                  },
                  server_ip_list: [{ip: '192.168.1.5', version: 'v4'}],
                  use_alphanumeric: 'false',
                  is_set_new_administrator_password: 'false',
                  ischanged_db_data_encryption: 'false',
                  ischanged_data_encryption: 'false',
                  eventlog: {event_log_retain_days: '60', active: 'false'},
                  log: {log_retain_days: '60', cron: '0 0 0 * * *', path: 'logs'}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/setting/biostar';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"BioStar":{"session_timeout":"216000","server_port":"51212","server_matching":{"matching-concurrency-count":2,"use-server-matching":false,"security-level":6,"fast-mode":true,"face-security-level":1},"user_sync_method":1,"user_by_device_sync_method":0,"log_sync_method":0,"check_duplicate_id_at_devices":0,"automatic_server_upgrade":0,"upgrade_when":0,"fingerprint_format":0,"licese_server_addr":"http://license.biostar2.com","backup":{"use":false,"cycle":2,"day":28,"weekday":2,"time":10800,"path":".\\bk","overwritable":"false"},"support_mobile_credential":"true","language":"en","server_addr":"","delete_credential_after_aoc":"false","secure_communication":{"mode":"0","use_external_cert":"false","enable_data_encryption":"false","enable_db_data_encryption":"false","ischanged_data_encryption":"false","ischanged_db_data_encryption":"false","enable_db_encryption":"false","is_random_encryption_key":"true","is_random_hash_key":"true","has_encryption_key":"false","has_hash_key":"true"},"system_security":{"password_strength":"2","use_password_update_cycle":"false","password_update_cycle":"60","use_allow_login_failed":"false","allow_login_failed_count":"5","allow_login_failed_minutes":"10","use_allow_password_change":"false","allow_password_change_count":"1","use_allow_simultaneous_connection":"true"},"web_request_timeout":"60","imglog_dir":".\\imagelog\\","websocket_cors":"*","enable_websocket_connection_bsSessionId":"false","enckey_dir":"C:\\Program Files\\BioStar 2(x64)\\util","device_event_log_skip_enroll_success_user":"false","http":{"port":"80","root_path":"html"},"https":{"use_ssl":"1","port":"443","ssl_addr":"192.168.1.5","server.ssl.key-store-password.use_enc":"1"},"cloud":{"use_cloud":"0","server_address":"api.biostar2.com","http_port":"52000","version":"v2","sub_domain":"oddbit","email":"team-suprema@oddbit.id","account_id":"611dcbe1f3e8e50a179b105c","email_use_enc":"1"},"tna":{"use_tna":"true","http_port":"3000","https_port":"3002","ngrok_port":"51000"},"video":{"use_video":"true","http_port":"3010","https_port":"3012","ngrok_port":"52002"},"licenses":[{"product_type":"1","name":"biostar_def","available":{"ZONE":"false","ELEVATOR":"false","SERVER_MATCHING":"false","CLOUD":"false","MOBILE_CARD":"false","GRAPHICMAP":"false"},"activated":"true"},{"product_type":"2","name":"biostar_std","activated":"false"},{"product_type":"3","name":"biostar_tna","activated":"false"},{"product_type":"4","name":"biostar2_basic","activated":"false"},{"product_type":"5","name":"biostar2_std","activated":"false"},{"product_type":"6","name":"biostar2_adv","available":{"ZONE":"true","ELEVATOR":"true","SERVER_MATCHING":"true","CLOUD":"true","MOBILE_CARD":"true","GRAPHICMAP":"true"},"activated":"true","customer":"Oddbit","expires_on":"permanent"},{"product_type":"7","name":"biostar2_pro","activated":"false"},{"product_type":"8","name":"biostar2_ent","activated":"false"},{"product_type":"9","name":"biostar2_video","activated":"false"},{"product_type":"10","name":"biostar2_visitor","activated":"false"},{"product_type":"11","name":"biostar2_tna_std","activated":"false"},{"product_type":"12","name":"biostar2_tna_adv","activated":"false"},{"product_type":"13","name":"biostar2_tna_pro","activated":"false"}],"mobile":{"use_mobile_credential":"1","email":"agni@supremainc.com","password":"****************","mc_server_addr":"https://api.mc.suprema.io","mc_port":"443","siteid":"6482","site_type":"REGULAR"},"log_level":{"enable":"true","log_retain_days":"60","level":"none","filter":{"SYS":"info","DBG":"none","NET":"info","WEB":"info","SQL":"none","WSS":"none"}},"server_ip_list":[{"ip":"192.168.1.5","version":"v4"}],"use_alphanumeric":"false","is_set_new_administrator_password":"false","ischanged_db_data_encryption":"false","ischanged_data_encryption":"false","eventlog":{"event_log_retain_days":"60","active":"false"},"log":{"log_retain_days":"60","cron":"0 0 0 * * *","path":"logs"}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"BioStar":{"session_timeout":"216000","server_port":"51212","server_matching":{"matching-concurrency-count":2,"use-server-matching":false,"security-level":6,"fast-mode":true,"face-security-level":1},"user_sync_method":1,"user_by_device_sync_method":0,"log_sync_method":0,"check_duplicate_id_at_devices":0,"automatic_server_upgrade":0,"upgrade_when":0,"fingerprint_format":0,"licese_server_addr":"http://license.biostar2.com","backup":{"use":false,"cycle":2,"day":28,"weekday":2,"time":10800,"path":".\\bk","overwritable":"false"},"support_mobile_credential":"true","language":"en","server_addr":"","delete_credential_after_aoc":"false","secure_communication":{"mode":"0","use_external_cert":"false","enable_data_encryption":"false","enable_db_data_encryption":"false","ischanged_data_encryption":"false","ischanged_db_data_encryption":"false","enable_db_encryption":"false","is_random_encryption_key":"true","is_random_hash_key":"true","has_encryption_key":"false","has_hash_key":"true"},"system_security":{"password_strength":"2","use_password_update_cycle":"false","password_update_cycle":"60","use_allow_login_failed":"false","allow_login_failed_count":"5","allow_login_failed_minutes":"10","use_allow_password_change":"false","allow_password_change_count":"1","use_allow_simultaneous_connection":"true"},"web_request_timeout":"60","imglog_dir":".\\imagelog\\","websocket_cors":"*","enable_websocket_connection_bsSessionId":"false","enckey_dir":"C:\\Program Files\\BioStar 2(x64)\\util","device_event_log_skip_enroll_success_user":"false","http":{"port":"80","root_path":"html"},"https":{"use_ssl":"1","port":"443","ssl_addr":"192.168.1.5","server.ssl.key-store-password.use_enc":"1"},"cloud":{"use_cloud":"0","server_address":"api.biostar2.com","http_port":"52000","version":"v2","sub_domain":"oddbit","email":"team-suprema@oddbit.id","account_id":"611dcbe1f3e8e50a179b105c","email_use_enc":"1"},"tna":{"use_tna":"true","http_port":"3000","https_port":"3002","ngrok_port":"51000"},"video":{"use_video":"true","http_port":"3010","https_port":"3012","ngrok_port":"52002"},"licenses":[{"product_type":"1","name":"biostar_def","available":{"ZONE":"false","ELEVATOR":"false","SERVER_MATCHING":"false","CLOUD":"false","MOBILE_CARD":"false","GRAPHICMAP":"false"},"activated":"true"},{"product_type":"2","name":"biostar_std","activated":"false"},{"product_type":"3","name":"biostar_tna","activated":"false"},{"product_type":"4","name":"biostar2_basic","activated":"false"},{"product_type":"5","name":"biostar2_std","activated":"false"},{"product_type":"6","name":"biostar2_adv","available":{"ZONE":"true","ELEVATOR":"true","SERVER_MATCHING":"true","CLOUD":"true","MOBILE_CARD":"true","GRAPHICMAP":"true"},"activated":"true","customer":"Oddbit","expires_on":"permanent"},{"product_type":"7","name":"biostar2_pro","activated":"false"},{"product_type":"8","name":"biostar2_ent","activated":"false"},{"product_type":"9","name":"biostar2_video","activated":"false"},{"product_type":"10","name":"biostar2_visitor","activated":"false"},{"product_type":"11","name":"biostar2_tna_std","activated":"false"},{"product_type":"12","name":"biostar2_tna_adv","activated":"false"},{"product_type":"13","name":"biostar2_tna_pro","activated":"false"}],"mobile":{"use_mobile_credential":"1","email":"agni@supremainc.com","password":"****************","mc_server_addr":"https://api.mc.suprema.io","mc_port":"443","siteid":"6482","site_type":"REGULAR"},"log_level":{"enable":"true","log_retain_days":"60","level":"none","filter":{"SYS":"info","DBG":"none","NET":"info","WEB":"info","SQL":"none","WSS":"none"}},"server_ip_list":[{"ip":"192.168.1.5","version":"v4"}],"use_alphanumeric":"false","is_set_new_administrator_password":"false","ischanged_db_data_encryption":"false","ischanged_data_encryption":"false","eventlog":{"event_log_retain_days":"60","active":"false"},"log":{"log_retain_days":"60","cron":"0 0 0 * * *","path":"logs"}}}'
            };

            fetch('https://{baseurl}/api/setting/biostar', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/biostar",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program Files\\\\BioStar 2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0 0 0 * * *\",\"path\":\"logs\"}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "BioStar": {
                "session_timeout": "216000",
                "server_port": "51212",
                "server_matching": {
                  "matching-concurrency-count": 2,
                  "use-server-matching": false,
                  "security-level": 6,
                  "fast-mode": true,
                  "face-security-level": 1
                },
                "user_sync_method": 1,
                "user_by_device_sync_method": 0,
                "log_sync_method": 0,
                "check_duplicate_id_at_devices": 0,
                "automatic_server_upgrade": 0,
                "upgrade_when": 0,
                "fingerprint_format": 0,
                "licese_server_addr": "http://license.biostar2.com",
                "backup": {
                  "use": false,
                  "cycle": 2,
                  "day": 28,
                  "weekday": 2,
                  "time": 10800,
                  "path": ".\\bk",
                  "overwritable": "false"
                },
                "support_mobile_credential": "true",
                "language": "en",
                "server_addr": "",
                "delete_credential_after_aoc": "false",
                "secure_communication": {
                  "mode": "0",
                  "use_external_cert": "false",
                  "enable_data_encryption": "false",
                  "enable_db_data_encryption": "false",
                  "ischanged_data_encryption": "false",
                  "ischanged_db_data_encryption": "false",
                  "enable_db_encryption": "false",
                  "is_random_encryption_key": "true",
                  "is_random_hash_key": "true",
                  "has_encryption_key": "false",
                  "has_hash_key": "true"
                },
                "system_security": {
                  "password_strength": "2",
                  "use_password_update_cycle": "false",
                  "password_update_cycle": "60",
                  "use_allow_login_failed": "false",
                  "allow_login_failed_count": "5",
                  "allow_login_failed_minutes": "10",
                  "use_allow_password_change": "false",
                  "allow_password_change_count": "1",
                  "use_allow_simultaneous_connection": "true"
                },
                "web_request_timeout": "60",
                "imglog_dir": ".\\imagelog\\",
                "websocket_cors": "*",
                "enable_websocket_connection_bsSessionId": "false",
                "enckey_dir": "C:\\Program Files\\BioStar 2(x64)\\util",
                "device_event_log_skip_enroll_success_user": "false",
                "http": {
                  "port": "80",
                  "root_path": "html"
                },
                "https": {
                  "use_ssl": "1",
                  "port": "443",
                  "ssl_addr": "192.168.1.5",
                  "server.ssl.key-store-password.use_enc": "1"
                },
                "cloud": {
                  "use_cloud": "0",
                  "server_address": "api.biostar2.com",
                  "http_port": "52000",
                  "version": "v2",
                  "sub_domain": "oddbit",
                  "email": "team-suprema@oddbit.id",
                  "account_id": "611dcbe1f3e8e50a179b105c",
                  "email_use_enc": "1"
                },
                "tna": {
                  "use_tna": "true",
                  "http_port": "3000",
                  "https_port": "3002",
                  "ngrok_port": "51000"
                },
                "video": {
                  "use_video": "true",
                  "http_port": "3010",
                  "https_port": "3012",
                  "ngrok_port": "52002"
                },
                "licenses": [
                  {
                    "product_type": "1",
                    "name": "biostar_def",
                    "available": {
                      "ZONE": "false",
                      "ELEVATOR": "false",
                      "SERVER_MATCHING": "false",
                      "CLOUD": "false",
                      "MOBILE_CARD": "false",
                      "GRAPHICMAP": "false"
                    },
                    "activated": "true"
                  },
                  {
                    "product_type": "2",
                    "name": "biostar_std",
                    "activated": "false"
                  },
                  {
                    "product_type": "3",
                    "name": "biostar_tna",
                    "activated": "false"
                  },
                  {
                    "product_type": "4",
                    "name": "biostar2_basic",
                    "activated": "false"
                  },
                  {
                    "product_type": "5",
                    "name": "biostar2_std",
                    "activated": "false"
                  },
                  {
                    "product_type": "6",
                    "name": "biostar2_adv",
                    "available": {
                      "ZONE": "true",
                      "ELEVATOR": "true",
                      "SERVER_MATCHING": "true",
                      "CLOUD": "true",
                      "MOBILE_CARD": "true",
                      "GRAPHICMAP": "true"
                    },
                    "activated": "true",
                    "customer": "Oddbit",
                    "expires_on": "permanent"
                  },
                  {
                    "product_type": "7",
                    "name": "biostar2_pro",
                    "activated": "false"
                  },
                  {
                    "product_type": "8",
                    "name": "biostar2_ent",
                    "activated": "false"
                  },
                  {
                    "product_type": "9",
                    "name": "biostar2_video",
                    "activated": "false"
                  },
                  {
                    "product_type": "10",
                    "name": "biostar2_visitor",
                    "activated": "false"
                  },
                  {
                    "product_type": "11",
                    "name": "biostar2_tna_std",
                    "activated": "false"
                  },
                  {
                    "product_type": "12",
                    "name": "biostar2_tna_adv",
                    "activated": "false"
                  },
                  {
                    "product_type": "13",
                    "name": "biostar2_tna_pro",
                    "activated": "false"
                  }
                ],
                "mobile": {
                  "use_mobile_credential": "1",
                  "email": "agni@supremainc.com",
                  "password": "****************",
                  "mc_server_addr": "https://api.mc.suprema.io",
                  "mc_port": "443",
                  "siteid": "6482",
                  "site_type": "REGULAR"
                },
                "log_level": {
                  "enable": "true",
                  "log_retain_days": "60",
                  "level": "none",
                  "filter": {
                    "SYS": "info",
                    "DBG": "none",
                    "NET": "info",
                    "WEB": "info",
                    "SQL": "none",
                    "WSS": "none"
                  }
                },
                "server_ip_list": [
                  {
                    "ip": "192.168.1.5",
                    "version": "v4"
                  }
                ],
                "use_alphanumeric": "false",
                "is_set_new_administrator_password": "false",
                "ischanged_db_data_encryption": "false",
                "ischanged_data_encryption": "false",
                "eventlog": {
                  "event_log_retain_days": "60",
                  "active": "false"
                },
                "log": {
                  "log_retain_days": "60",
                  "cron": "0 0 0 * * *",
                  "path": "logs"
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/setting/biostar");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0
            0 0 * * *\",\"path\":\"logs\"}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/setting/biostar", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/setting/biostar"


            payload = {"BioStar": {
                    "session_timeout": "216000",
                    "server_port": "51212",
                    "server_matching": {
                        "matching-concurrency-count": 2,
                        "use-server-matching": False,
                        "security-level": 6,
                        "fast-mode": True,
                        "face-security-level": 1
                    },
                    "user_sync_method": 1,
                    "user_by_device_sync_method": 0,
                    "log_sync_method": 0,
                    "check_duplicate_id_at_devices": 0,
                    "automatic_server_upgrade": 0,
                    "upgrade_when": 0,
                    "fingerprint_format": 0,
                    "licese_server_addr": "http://license.biostar2.com",
                    "backup": {
                        "use": False,
                        "cycle": 2,
                        "day": 28,
                        "weekday": 2,
                        "time": 10800,
                        "path": ".\bk",
                        "overwritable": "false"
                    },
                    "support_mobile_credential": "true",
                    "language": "en",
                    "server_addr": "",
                    "delete_credential_after_aoc": "false",
                    "secure_communication": {
                        "mode": "0",
                        "use_external_cert": "false",
                        "enable_data_encryption": "false",
                        "enable_db_data_encryption": "false",
                        "ischanged_data_encryption": "false",
                        "ischanged_db_data_encryption": "false",
                        "enable_db_encryption": "false",
                        "is_random_encryption_key": "true",
                        "is_random_hash_key": "true",
                        "has_encryption_key": "false",
                        "has_hash_key": "true"
                    },
                    "system_security": {
                        "password_strength": "2",
                        "use_password_update_cycle": "false",
                        "password_update_cycle": "60",
                        "use_allow_login_failed": "false",
                        "allow_login_failed_count": "5",
                        "allow_login_failed_minutes": "10",
                        "use_allow_password_change": "false",
                        "allow_password_change_count": "1",
                        "use_allow_simultaneous_connection": "true"
                    },
                    "web_request_timeout": "60",
                    "imglog_dir": ".\imagelog\",
                    "websocket_cors": "*",
                    "enable_websocket_connection_bsSessionId": "false",
                    "enckey_dir": "C:\Program Files\BioStar 2(x64)\util",
                    "device_event_log_skip_enroll_success_user": "false",
                    "http": {
                        "port": "80",
                        "root_path": "html"
                    },
                    "https": {
                        "use_ssl": "1",
                        "port": "443",
                        "ssl_addr": "192.168.1.5",
                        "server.ssl.key-store-password.use_enc": "1"
                    },
                    "cloud": {
                        "use_cloud": "0",
                        "server_address": "api.biostar2.com",
                        "http_port": "52000",
                        "version": "v2",
                        "sub_domain": "oddbit",
                        "email": "team-suprema@oddbit.id",
                        "account_id": "611dcbe1f3e8e50a179b105c",
                        "email_use_enc": "1"
                    },
                    "tna": {
                        "use_tna": "true",
                        "http_port": "3000",
                        "https_port": "3002",
                        "ngrok_port": "51000"
                    },
                    "video": {
                        "use_video": "true",
                        "http_port": "3010",
                        "https_port": "3012",
                        "ngrok_port": "52002"
                    },
                    "licenses": [
                        {
                            "product_type": "1",
                            "name": "biostar_def",
                            "available": {
                                "ZONE": "false",
                                "ELEVATOR": "false",
                                "SERVER_MATCHING": "false",
                                "CLOUD": "false",
                                "MOBILE_CARD": "false",
                                "GRAPHICMAP": "false"
                            },
                            "activated": "true"
                        },
                        {
                            "product_type": "2",
                            "name": "biostar_std",
                            "activated": "false"
                        },
                        {
                            "product_type": "3",
                            "name": "biostar_tna",
                            "activated": "false"
                        },
                        {
                            "product_type": "4",
                            "name": "biostar2_basic",
                            "activated": "false"
                        },
                        {
                            "product_type": "5",
                            "name": "biostar2_std",
                            "activated": "false"
                        },
                        {
                            "product_type": "6",
                            "name": "biostar2_adv",
                            "available": {
                                "ZONE": "true",
                                "ELEVATOR": "true",
                                "SERVER_MATCHING": "true",
                                "CLOUD": "true",
                                "MOBILE_CARD": "true",
                                "GRAPHICMAP": "true"
                            },
                            "activated": "true",
                            "customer": "Oddbit",
                            "expires_on": "permanent"
                        },
                        {
                            "product_type": "7",
                            "name": "biostar2_pro",
                            "activated": "false"
                        },
                        {
                            "product_type": "8",
                            "name": "biostar2_ent",
                            "activated": "false"
                        },
                        {
                            "product_type": "9",
                            "name": "biostar2_video",
                            "activated": "false"
                        },
                        {
                            "product_type": "10",
                            "name": "biostar2_visitor",
                            "activated": "false"
                        },
                        {
                            "product_type": "11",
                            "name": "biostar2_tna_std",
                            "activated": "false"
                        },
                        {
                            "product_type": "12",
                            "name": "biostar2_tna_adv",
                            "activated": "false"
                        },
                        {
                            "product_type": "13",
                            "name": "biostar2_tna_pro",
                            "activated": "false"
                        }
                    ],
                    "mobile": {
                        "use_mobile_credential": "1",
                        "email": "agni@supremainc.com",
                        "password": "****************",
                        "mc_server_addr": "https://api.mc.suprema.io",
                        "mc_port": "443",
                        "siteid": "6482",
                        "site_type": "REGULAR"
                    },
                    "log_level": {
                        "enable": "true",
                        "log_retain_days": "60",
                        "level": "none",
                        "filter": {
                            "SYS": "info",
                            "DBG": "none",
                            "NET": "info",
                            "WEB": "info",
                            "SQL": "none",
                            "WSS": "none"
                        }
                    },
                    "server_ip_list": [
                        {
                            "ip": "192.168.1.5",
                            "version": "v4"
                        }
                    ],
                    "use_alphanumeric": "false",
                    "is_set_new_administrator_password": "false",
                    "ischanged_db_data_encryption": "false",
                    "ischanged_data_encryption": "false",
                    "eventlog": {
                        "event_log_retain_days": "60",
                        "active": "false"
                    },
                    "log": {
                        "log_retain_days": "60",
                        "cron": "0 0 0 * * *",
                        "path": "logs"
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/setting/biostar")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0
            0 0 * * *\",\"path\":\"logs\"}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/biostar",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program Files\\\\BioStar 2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0 0 0 * * *\",\"path\":\"logs\"}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/setting/biostar');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"BioStar":{"session_timeout":"216000","server_port":"51212","server_matching":{"matching-concurrency-count":2,"use-server-matching":false,"security-level":6,"fast-mode":true,"face-security-level":1},"user_sync_method":1,"user_by_device_sync_method":0,"log_sync_method":0,"check_duplicate_id_at_devices":0,"automatic_server_upgrade":0,"upgrade_when":0,"fingerprint_format":0,"licese_server_addr":"http://license.biostar2.com","backup":{"use":false,"cycle":2,"day":28,"weekday":2,"time":10800,"path":".\\\\bk","overwritable":"false"},"support_mobile_credential":"true","language":"en","server_addr":"","delete_credential_after_aoc":"false","secure_communication":{"mode":"0","use_external_cert":"false","enable_data_encryption":"false","enable_db_data_encryption":"false","ischanged_data_encryption":"false","ischanged_db_data_encryption":"false","enable_db_encryption":"false","is_random_encryption_key":"true","is_random_hash_key":"true","has_encryption_key":"false","has_hash_key":"true"},"system_security":{"password_strength":"2","use_password_update_cycle":"false","password_update_cycle":"60","use_allow_login_failed":"false","allow_login_failed_count":"5","allow_login_failed_minutes":"10","use_allow_password_change":"false","allow_password_change_count":"1","use_allow_simultaneous_connection":"true"},"web_request_timeout":"60","imglog_dir":".\\\\imagelog\\\\","websocket_cors":"*","enable_websocket_connection_bsSessionId":"false","enckey_dir":"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\util","device_event_log_skip_enroll_success_user":"false","http":{"port":"80","root_path":"html"},"https":{"use_ssl":"1","port":"443","ssl_addr":"192.168.1.5","server.ssl.key-store-password.use_enc":"1"},"cloud":{"use_cloud":"0","server_address":"api.biostar2.com","http_port":"52000","version":"v2","sub_domain":"oddbit","email":"team-suprema@oddbit.id","account_id":"611dcbe1f3e8e50a179b105c","email_use_enc":"1"},"tna":{"use_tna":"true","http_port":"3000","https_port":"3002","ngrok_port":"51000"},"video":{"use_video":"true","http_port":"3010","https_port":"3012","ngrok_port":"52002"},"licenses":[{"product_type":"1","name":"biostar_def","available":{"ZONE":"false","ELEVATOR":"false","SERVER_MATCHING":"false","CLOUD":"false","MOBILE_CARD":"false","GRAPHICMAP":"false"},"activated":"true"},{"product_type":"2","name":"biostar_std","activated":"false"},{"product_type":"3","name":"biostar_tna","activated":"false"},{"product_type":"4","name":"biostar2_basic","activated":"false"},{"product_type":"5","name":"biostar2_std","activated":"false"},{"product_type":"6","name":"biostar2_adv","available":{"ZONE":"true","ELEVATOR":"true","SERVER_MATCHING":"true","CLOUD":"true","MOBILE_CARD":"true","GRAPHICMAP":"true"},"activated":"true","customer":"Oddbit","expires_on":"permanent"},{"product_type":"7","name":"biostar2_pro","activated":"false"},{"product_type":"8","name":"biostar2_ent","activated":"false"},{"product_type":"9","name":"biostar2_video","activated":"false"},{"product_type":"10","name":"biostar2_visitor","activated":"false"},{"product_type":"11","name":"biostar2_tna_std","activated":"false"},{"product_type":"12","name":"biostar2_tna_adv","activated":"false"},{"product_type":"13","name":"biostar2_tna_pro","activated":"false"}],"mobile":{"use_mobile_credential":"1","email":"agni@supremainc.com","password":"****************","mc_server_addr":"https://api.mc.suprema.io","mc_port":"443","siteid":"6482","site_type":"REGULAR"},"log_level":{"enable":"true","log_retain_days":"60","level":"none","filter":{"SYS":"info","DBG":"none","NET":"info","WEB":"info","SQL":"none","WSS":"none"}},"server_ip_list":[{"ip":"192.168.1.5","version":"v4"}],"use_alphanumeric":"false","is_set_new_administrator_password":"false","ischanged_db_data_encryption":"false","ischanged_data_encryption":"false","eventlog":{"event_log_retain_days":"60","active":"false"},"log":{"log_retain_days":"60","cron":"0
            0 0 * * *","path":"logs"}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"BioStar":{"session_timeout":"216000","server_port":"51212","server_matching":{"matching-concurrency-count":2,"use-server-matching":false,"security-level":6,"fast-mode":true,"face-security-level":1},"user_sync_method":1,"user_by_device_sync_method":0,"log_sync_method":0,"check_duplicate_id_at_devices":0,"automatic_server_upgrade":0,"upgrade_when":0,"fingerprint_format":0,"licese_server_addr":"http://license.biostar2.com","backup":{"use":false,"cycle":2,"day":28,"weekday":2,"time":10800,"path":".\\\\bk","overwritable":"false"},"support_mobile_credential":"true","language":"en","server_addr":"","delete_credential_after_aoc":"false","secure_communication":{"mode":"0","use_external_cert":"false","enable_data_encryption":"false","enable_db_data_encryption":"false","ischanged_data_encryption":"false","ischanged_db_data_encryption":"false","enable_db_encryption":"false","is_random_encryption_key":"true","is_random_hash_key":"true","has_encryption_key":"false","has_hash_key":"true"},"system_security":{"password_strength":"2","use_password_update_cycle":"false","password_update_cycle":"60","use_allow_login_failed":"false","allow_login_failed_count":"5","allow_login_failed_minutes":"10","use_allow_password_change":"false","allow_password_change_count":"1","use_allow_simultaneous_connection":"true"},"web_request_timeout":"60","imglog_dir":".\\\\imagelog\\\\","websocket_cors":"*","enable_websocket_connection_bsSessionId":"false","enckey_dir":"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\util","device_event_log_skip_enroll_success_user":"false","http":{"port":"80","root_path":"html"},"https":{"use_ssl":"1","port":"443","ssl_addr":"192.168.1.5","server.ssl.key-store-password.use_enc":"1"},"cloud":{"use_cloud":"0","server_address":"api.biostar2.com","http_port":"52000","version":"v2","sub_domain":"oddbit","email":"team-suprema@oddbit.id","account_id":"611dcbe1f3e8e50a179b105c","email_use_enc":"1"},"tna":{"use_tna":"true","http_port":"3000","https_port":"3002","ngrok_port":"51000"},"video":{"use_video":"true","http_port":"3010","https_port":"3012","ngrok_port":"52002"},"licenses":[{"product_type":"1","name":"biostar_def","available":{"ZONE":"false","ELEVATOR":"false","SERVER_MATCHING":"false","CLOUD":"false","MOBILE_CARD":"false","GRAPHICMAP":"false"},"activated":"true"},{"product_type":"2","name":"biostar_std","activated":"false"},{"product_type":"3","name":"biostar_tna","activated":"false"},{"product_type":"4","name":"biostar2_basic","activated":"false"},{"product_type":"5","name":"biostar2_std","activated":"false"},{"product_type":"6","name":"biostar2_adv","available":{"ZONE":"true","ELEVATOR":"true","SERVER_MATCHING":"true","CLOUD":"true","MOBILE_CARD":"true","GRAPHICMAP":"true"},"activated":"true","customer":"Oddbit","expires_on":"permanent"},{"product_type":"7","name":"biostar2_pro","activated":"false"},{"product_type":"8","name":"biostar2_ent","activated":"false"},{"product_type":"9","name":"biostar2_video","activated":"false"},{"product_type":"10","name":"biostar2_visitor","activated":"false"},{"product_type":"11","name":"biostar2_tna_std","activated":"false"},{"product_type":"12","name":"biostar2_tna_adv","activated":"false"},{"product_type":"13","name":"biostar2_tna_pro","activated":"false"}],"mobile":{"use_mobile_credential":"1","email":"agni@supremainc.com","password":"****************","mc_server_addr":"https://api.mc.suprema.io","mc_port":"443","siteid":"6482","site_type":"REGULAR"},"log_level":{"enable":"true","log_retain_days":"60","level":"none","filter":{"SYS":"info","DBG":"none","NET":"info","WEB":"info","SQL":"none","WSS":"none"}},"server_ip_list":[{"ip":"192.168.1.5","version":"v4"}],"use_alphanumeric":"false","is_set_new_administrator_password":"false","ischanged_db_data_encryption":"false","ischanged_data_encryption":"false","eventlog":{"event_log_retain_days":"60","active":"false"},"log":{"log_retain_days":"60","cron":"0
            0 0 * * *","path":"logs"}}}');


            $request->setRequestUrl('https://{baseurl}/api/setting/biostar');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0
            0 0 * * *\",\"path\":\"logs\"}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/biostar")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/setting/biostar")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program Files\\\\BioStar 2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0 0 0 * * *\",\"path\":\"logs\"}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/biostar\"\n\n\tpayload := strings.NewReader(\"{\\\"BioStar\\\":{\\\"session_timeout\\\":\\\"216000\\\",\\\"server_port\\\":\\\"51212\\\",\\\"server_matching\\\":{\\\"matching-concurrency-count\\\":2,\\\"use-server-matching\\\":false,\\\"security-level\\\":6,\\\"fast-mode\\\":true,\\\"face-security-level\\\":1},\\\"user_sync_method\\\":1,\\\"user_by_device_sync_method\\\":0,\\\"log_sync_method\\\":0,\\\"check_duplicate_id_at_devices\\\":0,\\\"automatic_server_upgrade\\\":0,\\\"upgrade_when\\\":0,\\\"fingerprint_format\\\":0,\\\"licese_server_addr\\\":\\\"http://license.biostar2.com\\\",\\\"backup\\\":{\\\"use\\\":false,\\\"cycle\\\":2,\\\"day\\\":28,\\\"weekday\\\":2,\\\"time\\\":10800,\\\"path\\\":\\\".\\\\\\\\bk\\\",\\\"overwritable\\\":\\\"false\\\"},\\\"support_mobile_credential\\\":\\\"true\\\",\\\"language\\\":\\\"en\\\",\\\"server_addr\\\":\\\"\\\",\\\"delete_credential_after_aoc\\\":\\\"false\\\",\\\"secure_communication\\\":{\\\"mode\\\":\\\"0\\\",\\\"use_external_cert\\\":\\\"false\\\",\\\"enable_data_encryption\\\":\\\"false\\\",\\\"enable_db_data_encryption\\\":\\\"false\\\",\\\"ischanged_data_encryption\\\":\\\"false\\\",\\\"ischanged_db_data_encryption\\\":\\\"false\\\",\\\"enable_db_encryption\\\":\\\"false\\\",\\\"is_random_encryption_key\\\":\\\"true\\\",\\\"is_random_hash_key\\\":\\\"true\\\",\\\"has_encryption_key\\\":\\\"false\\\",\\\"has_hash_key\\\":\\\"true\\\"},\\\"system_security\\\":{\\\"password_strength\\\":\\\"2\\\",\\\"use_password_update_cycle\\\":\\\"false\\\",\\\"password_update_cycle\\\":\\\"60\\\",\\\"use_allow_login_failed\\\":\\\"false\\\",\\\"allow_login_failed_count\\\":\\\"5\\\",\\\"allow_login_failed_minutes\\\":\\\"10\\\",\\\"use_allow_password_change\\\":\\\"false\\\",\\\"allow_password_change_count\\\":\\\"1\\\",\\\"use_allow_simultaneous_connection\\\":\\\"true\\\"},\\\"web_request_timeout\\\":\\\"60\\\",\\\"imglog_dir\\\":\\\".\\\\\\\\imagelog\\\\\\\\\\\",\\\"websocket_cors\\\":\\\"*\\\",\\\"enable_websocket_connection_bsSessionId\\\":\\\"false\\\",\\\"enckey_dir\\\":\\\"C:\\\\\\\\Program Files\\\\\\\\BioStar 2(x64)\\\\\\\\util\\\",\\\"device_event_log_skip_enroll_success_user\\\":\\\"false\\\",\\\"http\\\":{\\\"port\\\":\\\"80\\\",\\\"root_path\\\":\\\"html\\\"},\\\"https\\\":{\\\"use_ssl\\\":\\\"1\\\",\\\"port\\\":\\\"443\\\",\\\"ssl_addr\\\":\\\"192.168.1.5\\\",\\\"server.ssl.key-store-password.use_enc\\\":\\\"1\\\"},\\\"cloud\\\":{\\\"use_cloud\\\":\\\"0\\\",\\\"server_address\\\":\\\"api.biostar2.com\\\",\\\"http_port\\\":\\\"52000\\\",\\\"version\\\":\\\"v2\\\",\\\"sub_domain\\\":\\\"oddbit\\\",\\\"email\\\":\\\"team-suprema@oddbit.id\\\",\\\"account_id\\\":\\\"611dcbe1f3e8e50a179b105c\\\",\\\"email_use_enc\\\":\\\"1\\\"},\\\"tna\\\":{\\\"use_tna\\\":\\\"true\\\",\\\"http_port\\\":\\\"3000\\\",\\\"https_port\\\":\\\"3002\\\",\\\"ngrok_port\\\":\\\"51000\\\"},\\\"video\\\":{\\\"use_video\\\":\\\"true\\\",\\\"http_port\\\":\\\"3010\\\",\\\"https_port\\\":\\\"3012\\\",\\\"ngrok_port\\\":\\\"52002\\\"},\\\"licenses\\\":[{\\\"product_type\\\":\\\"1\\\",\\\"name\\\":\\\"biostar_def\\\",\\\"available\\\":{\\\"ZONE\\\":\\\"false\\\",\\\"ELEVATOR\\\":\\\"false\\\",\\\"SERVER_MATCHING\\\":\\\"false\\\",\\\"CLOUD\\\":\\\"false\\\",\\\"MOBILE_CARD\\\":\\\"false\\\",\\\"GRAPHICMAP\\\":\\\"false\\\"},\\\"activated\\\":\\\"true\\\"},{\\\"product_type\\\":\\\"2\\\",\\\"name\\\":\\\"biostar_std\\\",\\\"activated\\\":\\\"false\\\"},{\\\"product_type\\\":\\\"3\\\",\\\"name\\\":\\\"biostar_tna\\\",\\\"activated\\\":\\\"false\\\"},{\\\"product_type\\\":\\\"4\\\",\\\"name\\\":\\\"biostar2_basic\\\",\\\"activated\\\":\\\"false\\\"},{\\\"product_type\\\":\\\"5\\\",\\\"name\\\":\\\"biostar2_std\\\",\\\"activated\\\":\\\"false\\\"},{\\\"product_type\\\":\\\"6\\\",\\\"name\\\":\\\"biostar2_adv\\\",\\\"available\\\":{\\\"ZONE\\\":\\\"true\\\",\\\"ELEVATOR\\\":\\\"true\\\",\\\"SERVER_MATCHING\\\":\\\"true\\\",\\\"CLOUD\\\":\\\"true\\\",\\\"MOBILE_CARD\\\":\\\"true\\\",\\\"GRAPHICMAP\\\":\\\"true\\\"},\\\"activated\\\":\\\"true\\\",\\\"customer\\\":\\\"Oddbit\\\",\\\"expires_on\\\":\\\"permanent\\\"},{\\\"product_type\\\":\\\"7\\\",\\\"name\\\":\\\"biostar2_pro\\\",\\\"activated\\\":\\\"false\\\"},{\\\"product_type\\\":\\\"8\\\",\\\"name\\\":\\\"biostar2_ent\\\",\\\"activated\\\":\\\"false\\\"},{\\\"product_type\\\":\\\"9\\\",\\\"name\\\":\\\"biostar2_video\\\",\\\"activated\\\":\\\"false\\\"},{\\\"product_type\\\":\\\"10\\\",\\\"name\\\":\\\"biostar2_visitor\\\",\\\"activated\\\":\\\"false\\\"},{\\\"product_type\\\":\\\"11\\\",\\\"name\\\":\\\"biostar2_tna_std\\\",\\\"activated\\\":\\\"false\\\"},{\\\"product_type\\\":\\\"12\\\",\\\"name\\\":\\\"biostar2_tna_adv\\\",\\\"activated\\\":\\\"false\\\"},{\\\"product_type\\\":\\\"13\\\",\\\"name\\\":\\\"biostar2_tna_pro\\\",\\\"activated\\\":\\\"false\\\"}],\\\"mobile\\\":{\\\"use_mobile_credential\\\":\\\"1\\\",\\\"email\\\":\\\"agni@supremainc.com\\\",\\\"password\\\":\\\"****************\\\",\\\"mc_server_addr\\\":\\\"https://api.mc.suprema.io\\\",\\\"mc_port\\\":\\\"443\\\",\\\"siteid\\\":\\\"6482\\\",\\\"site_type\\\":\\\"REGULAR\\\"},\\\"log_level\\\":{\\\"enable\\\":\\\"true\\\",\\\"log_retain_days\\\":\\\"60\\\",\\\"level\\\":\\\"none\\\",\\\"filter\\\":{\\\"SYS\\\":\\\"info\\\",\\\"DBG\\\":\\\"none\\\",\\\"NET\\\":\\\"info\\\",\\\"WEB\\\":\\\"info\\\",\\\"SQL\\\":\\\"none\\\",\\\"WSS\\\":\\\"none\\\"}},\\\"server_ip_list\\\":[{\\\"ip\\\":\\\"192.168.1.5\\\",\\\"version\\\":\\\"v4\\\"}],\\\"use_alphanumeric\\\":\\\"false\\\",\\\"is_set_new_administrator_password\\\":\\\"false\\\",\\\"ischanged_db_data_encryption\\\":\\\"false\\\",\\\"ischanged_data_encryption\\\":\\\"false\\\",\\\"eventlog\\\":{\\\"event_log_retain_days\\\":\\\"60\\\",\\\"active\\\":\\\"false\\\"},\\\"log\\\":{\\\"log_retain_days\\\":\\\"60\\\",\\\"cron\\\":\\\"0 0 0 * * *\\\",\\\"path\\\":\\\"logs\\\"}}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/biostar");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0
            0 0 * * *\",\"path\":\"logs\"}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"BioStar": @{ @"session_timeout":
            @"216000", @"server_port": @"51212", @"server_matching": @{
            @"matching-concurrency-count": @2, @"use-server-matching": @NO,
            @"security-level": @6, @"fast-mode": @YES, @"face-security-level":
            @1 }, @"user_sync_method": @1, @"user_by_device_sync_method": @0,
            @"log_sync_method": @0, @"check_duplicate_id_at_devices": @0,
            @"automatic_server_upgrade": @0, @"upgrade_when": @0,
            @"fingerprint_format": @0, @"licese_server_addr":
            @"http://license.biostar2.com", @"backup": @{ @"use": @NO, @"cycle":
            @2, @"day": @28, @"weekday": @2, @"time": @10800, @"path": @".\bk",
            @"overwritable": @"false" }, @"support_mobile_credential": @"true",
            @"language": @"en", @"server_addr": @"",
            @"delete_credential_after_aoc": @"false", @"secure_communication":
            @{ @"mode": @"0", @"use_external_cert": @"false",
            @"enable_data_encryption": @"false", @"enable_db_data_encryption":
            @"false", @"ischanged_data_encryption": @"false",
            @"ischanged_db_data_encryption": @"false", @"enable_db_encryption":
            @"false", @"is_random_encryption_key": @"true",
            @"is_random_hash_key": @"true", @"has_encryption_key": @"false",
            @"has_hash_key": @"true" }, @"system_security": @{
            @"password_strength": @"2", @"use_password_update_cycle": @"false",
            @"password_update_cycle": @"60", @"use_allow_login_failed":
            @"false", @"allow_login_failed_count": @"5",
            @"allow_login_failed_minutes": @"10", @"use_allow_password_change":
            @"false", @"allow_password_change_count": @"1",
            @"use_allow_simultaneous_connection": @"true" },
            @"web_request_timeout": @"60", @"imglog_dir": @".\imagelog\",
            @"websocket_cors": @"*", @"enable_websocket_connection_bsSessionId":
            @"false", @"enckey_dir": @"C:\Program Files\BioStar 2(x64)\util",
            @"device_event_log_skip_enroll_success_user": @"false", @"http": @{
            @"port": @"80", @"root_path": @"html" }, @"https": @{ @"use_ssl":
            @"1", @"port": @"443", @"ssl_addr": @"192.168.1.5",
            @"server.ssl.key-store-password.use_enc": @"1" }, @"cloud": @{
            @"use_cloud": @"0", @"server_address": @"api.biostar2.com",
            @"http_port": @"52000", @"version": @"v2", @"sub_domain": @"oddbit",
            @"email": @"team-suprema@oddbit.id", @"account_id":
            @"611dcbe1f3e8e50a179b105c", @"email_use_enc": @"1" }, @"tna": @{
            @"use_tna": @"true", @"http_port": @"3000", @"https_port": @"3002",
            @"ngrok_port": @"51000" }, @"video": @{ @"use_video": @"true",
            @"http_port": @"3010", @"https_port": @"3012", @"ngrok_port":
            @"52002" }, @"licenses": @[ @{ @"product_type": @"1", @"name":
            @"biostar_def", @"available": @{ @"ZONE": @"false", @"ELEVATOR":
            @"false", @"SERVER_MATCHING": @"false", @"CLOUD": @"false",
            @"MOBILE_CARD": @"false", @"GRAPHICMAP": @"false" }, @"activated":
            @"true" }, @{ @"product_type": @"2", @"name": @"biostar_std",
            @"activated": @"false" }, @{ @"product_type": @"3", @"name":
            @"biostar_tna", @"activated": @"false" }, @{ @"product_type": @"4",
            @"name": @"biostar2_basic", @"activated": @"false" }, @{
            @"product_type": @"5", @"name": @"biostar2_std", @"activated":
            @"false" }, @{ @"product_type": @"6", @"name": @"biostar2_adv",
            @"available": @{ @"ZONE": @"true", @"ELEVATOR": @"true",
            @"SERVER_MATCHING": @"true", @"CLOUD": @"true", @"MOBILE_CARD":
            @"true", @"GRAPHICMAP": @"true" }, @"activated": @"true",
            @"customer": @"Oddbit", @"expires_on": @"permanent" }, @{
            @"product_type": @"7", @"name": @"biostar2_pro", @"activated":
            @"false" }, @{ @"product_type": @"8", @"name": @"biostar2_ent",
            @"activated": @"false" }, @{ @"product_type": @"9", @"name":
            @"biostar2_video", @"activated": @"false" }, @{ @"product_type":
            @"10", @"name": @"biostar2_visitor", @"activated": @"false" }, @{
            @"product_type": @"11", @"name": @"biostar2_tna_std", @"activated":
            @"false" }, @{ @"product_type": @"12", @"name": @"biostar2_tna_adv",
            @"activated": @"false" }, @{ @"product_type": @"13", @"name":
            @"biostar2_tna_pro", @"activated": @"false" } ], @"mobile": @{
            @"use_mobile_credential": @"1", @"email": @"agni@supremainc.com",
            @"password": @"****************", @"mc_server_addr":
            @"https://api.mc.suprema.io", @"mc_port": @"443", @"siteid":
            @"6482", @"site_type": @"REGULAR" }, @"log_level": @{ @"enable":
            @"true", @"log_retain_days": @"60", @"level": @"none", @"filter": @{
            @"SYS": @"info", @"DBG": @"none", @"NET": @"info", @"WEB": @"info",
            @"SQL": @"none", @"WSS": @"none" } }, @"server_ip_list": @[ @{
            @"ip": @"192.168.1.5", @"version": @"v4" } ], @"use_alphanumeric":
            @"false", @"is_set_new_administrator_password": @"false",
            @"ischanged_db_data_encryption": @"false",
            @"ischanged_data_encryption": @"false", @"eventlog": @{
            @"event_log_retain_days": @"60", @"active": @"false" }, @"log": @{
            @"log_retain_days": @"60", @"cron": @"0 0 0 * * *", @"path": @"logs"
            } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/biostar"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["BioStar": [
                "session_timeout": "216000",
                "server_port": "51212",
                "server_matching": [
                  "matching-concurrency-count": 2,
                  "use-server-matching": false,
                  "security-level": 6,
                  "fast-mode": true,
                  "face-security-level": 1
                ],
                "user_sync_method": 1,
                "user_by_device_sync_method": 0,
                "log_sync_method": 0,
                "check_duplicate_id_at_devices": 0,
                "automatic_server_upgrade": 0,
                "upgrade_when": 0,
                "fingerprint_format": 0,
                "licese_server_addr": "http://license.biostar2.com",
                "backup": [
                  "use": false,
                  "cycle": 2,
                  "day": 28,
                  "weekday": 2,
                  "time": 10800,
                  "path": ".\bk",
                  "overwritable": "false"
                ],
                "support_mobile_credential": "true",
                "language": "en",
                "server_addr": "",
                "delete_credential_after_aoc": "false",
                "secure_communication": [
                  "mode": "0",
                  "use_external_cert": "false",
                  "enable_data_encryption": "false",
                  "enable_db_data_encryption": "false",
                  "ischanged_data_encryption": "false",
                  "ischanged_db_data_encryption": "false",
                  "enable_db_encryption": "false",
                  "is_random_encryption_key": "true",
                  "is_random_hash_key": "true",
                  "has_encryption_key": "false",
                  "has_hash_key": "true"
                ],
                "system_security": [
                  "password_strength": "2",
                  "use_password_update_cycle": "false",
                  "password_update_cycle": "60",
                  "use_allow_login_failed": "false",
                  "allow_login_failed_count": "5",
                  "allow_login_failed_minutes": "10",
                  "use_allow_password_change": "false",
                  "allow_password_change_count": "1",
                  "use_allow_simultaneous_connection": "true"
                ],
                "web_request_timeout": "60",
                "imglog_dir": ".\imagelog\",
                "websocket_cors": "*",
                "enable_websocket_connection_bsSessionId": "false",
                "enckey_dir": "C:\Program Files\BioStar 2(x64)\util",
                "device_event_log_skip_enroll_success_user": "false",
                "http": [
                  "port": "80",
                  "root_path": "html"
                ],
                "https": [
                  "use_ssl": "1",
                  "port": "443",
                  "ssl_addr": "192.168.1.5",
                  "server.ssl.key-store-password.use_enc": "1"
                ],
                "cloud": [
                  "use_cloud": "0",
                  "server_address": "api.biostar2.com",
                  "http_port": "52000",
                  "version": "v2",
                  "sub_domain": "oddbit",
                  "email": "team-suprema@oddbit.id",
                  "account_id": "611dcbe1f3e8e50a179b105c",
                  "email_use_enc": "1"
                ],
                "tna": [
                  "use_tna": "true",
                  "http_port": "3000",
                  "https_port": "3002",
                  "ngrok_port": "51000"
                ],
                "video": [
                  "use_video": "true",
                  "http_port": "3010",
                  "https_port": "3012",
                  "ngrok_port": "52002"
                ],
                "licenses": [
                  [
                    "product_type": "1",
                    "name": "biostar_def",
                    "available": [
                      "ZONE": "false",
                      "ELEVATOR": "false",
                      "SERVER_MATCHING": "false",
                      "CLOUD": "false",
                      "MOBILE_CARD": "false",
                      "GRAPHICMAP": "false"
                    ],
                    "activated": "true"
                  ],
                  [
                    "product_type": "2",
                    "name": "biostar_std",
                    "activated": "false"
                  ],
                  [
                    "product_type": "3",
                    "name": "biostar_tna",
                    "activated": "false"
                  ],
                  [
                    "product_type": "4",
                    "name": "biostar2_basic",
                    "activated": "false"
                  ],
                  [
                    "product_type": "5",
                    "name": "biostar2_std",
                    "activated": "false"
                  ],
                  [
                    "product_type": "6",
                    "name": "biostar2_adv",
                    "available": [
                      "ZONE": "true",
                      "ELEVATOR": "true",
                      "SERVER_MATCHING": "true",
                      "CLOUD": "true",
                      "MOBILE_CARD": "true",
                      "GRAPHICMAP": "true"
                    ],
                    "activated": "true",
                    "customer": "Oddbit",
                    "expires_on": "permanent"
                  ],
                  [
                    "product_type": "7",
                    "name": "biostar2_pro",
                    "activated": "false"
                  ],
                  [
                    "product_type": "8",
                    "name": "biostar2_ent",
                    "activated": "false"
                  ],
                  [
                    "product_type": "9",
                    "name": "biostar2_video",
                    "activated": "false"
                  ],
                  [
                    "product_type": "10",
                    "name": "biostar2_visitor",
                    "activated": "false"
                  ],
                  [
                    "product_type": "11",
                    "name": "biostar2_tna_std",
                    "activated": "false"
                  ],
                  [
                    "product_type": "12",
                    "name": "biostar2_tna_adv",
                    "activated": "false"
                  ],
                  [
                    "product_type": "13",
                    "name": "biostar2_tna_pro",
                    "activated": "false"
                  ]
                ],
                "mobile": [
                  "use_mobile_credential": "1",
                  "email": "agni@supremainc.com",
                  "password": "****************",
                  "mc_server_addr": "https://api.mc.suprema.io",
                  "mc_port": "443",
                  "siteid": "6482",
                  "site_type": "REGULAR"
                ],
                "log_level": [
                  "enable": "true",
                  "log_retain_days": "60",
                  "level": "none",
                  "filter": [
                    "SYS": "info",
                    "DBG": "none",
                    "NET": "info",
                    "WEB": "info",
                    "SQL": "none",
                    "WSS": "none"
                  ]
                ],
                "server_ip_list": [
                  [
                    "ip": "192.168.1.5",
                    "version": "v4"
                  ]
                ],
                "use_alphanumeric": "false",
                "is_set_new_administrator_password": "false",
                "ischanged_db_data_encryption": "false",
                "ischanged_data_encryption": "false",
                "eventlog": [
                  "event_log_retain_days": "60",
                  "active": "false"
                ],
                "log": [
                  "log_retain_days": "60",
                  "cron": "0 0 0 * * *",
                  "path": "logs"
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/biostar")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/biostar");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0
            0 0 * * *\",\"path\":\"logs\"}}}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/setting/biostar"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program Files\\\\BioStar 2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0 0 0 * * *\",\"path\":\"logs\"}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/biostar' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"BioStar":{"session_timeout":"216000","server_port":"51212","server_matching":{"matching-concurrency-count":2,"use-server-matching":false,"security-level":6,"fast-mode":true,"face-security-level":1},"user_sync_method":1,"user_by_device_sync_method":0,"log_sync_method":0,"check_duplicate_id_at_devices":0,"automatic_server_upgrade":0,"upgrade_when":0,"fingerprint_format":0,"licese_server_addr":"http://license.biostar2.com","backup":{"use":false,"cycle":2,"day":28,"weekday":2,"time":10800,"path":".\\bk","overwritable":"false"},"support_mobile_credential":"true","language":"en","server_addr":"","delete_credential_after_aoc":"false","secure_communication":{"mode":"0","use_external_cert":"false","enable_data_encryption":"false","enable_db_data_encryption":"false","ischanged_data_encryption":"false","ischanged_db_data_encryption":"false","enable_db_encryption":"false","is_random_encryption_key":"true","is_random_hash_key":"true","has_encryption_key":"false","has_hash_key":"true"},"system_security":{"password_strength":"2","use_password_update_cycle":"false","password_update_cycle":"60","use_allow_login_failed":"false","allow_login_failed_count":"5","allow_login_failed_minutes":"10","use_allow_password_change":"false","allow_password_change_count":"1","use_allow_simultaneous_connection":"true"},"web_request_timeout":"60","imglog_dir":".\\imagelog\\","websocket_cors":"*","enable_websocket_connection_bsSessionId":"false","enckey_dir":"C:\\Program
            Files\\BioStar
            2(x64)\\util","device_event_log_skip_enroll_success_user":"false","http":{"port":"80","root_path":"html"},"https":{"use_ssl":"1","port":"443","ssl_addr":"192.168.1.5","server.ssl.key-store-password.use_enc":"1"},"cloud":{"use_cloud":"0","server_address":"api.biostar2.com","http_port":"52000","version":"v2","sub_domain":"oddbit","email":"team-suprema@oddbit.id","account_id":"611dcbe1f3e8e50a179b105c","email_use_enc":"1"},"tna":{"use_tna":"true","http_port":"3000","https_port":"3002","ngrok_port":"51000"},"video":{"use_video":"true","http_port":"3010","https_port":"3012","ngrok_port":"52002"},"licenses":[{"product_type":"1","name":"biostar_def","available":{"ZONE":"false","ELEVATOR":"false","SERVER_MATCHING":"false","CLOUD":"false","MOBILE_CARD":"false","GRAPHICMAP":"false"},"activated":"true"},{"product_type":"2","name":"biostar_std","activated":"false"},{"product_type":"3","name":"biostar_tna","activated":"false"},{"product_type":"4","name":"biostar2_basic","activated":"false"},{"product_type":"5","name":"biostar2_std","activated":"false"},{"product_type":"6","name":"biostar2_adv","available":{"ZONE":"true","ELEVATOR":"true","SERVER_MATCHING":"true","CLOUD":"true","MOBILE_CARD":"true","GRAPHICMAP":"true"},"activated":"true","customer":"Oddbit","expires_on":"permanent"},{"product_type":"7","name":"biostar2_pro","activated":"false"},{"product_type":"8","name":"biostar2_ent","activated":"false"},{"product_type":"9","name":"biostar2_video","activated":"false"},{"product_type":"10","name":"biostar2_visitor","activated":"false"},{"product_type":"11","name":"biostar2_tna_std","activated":"false"},{"product_type":"12","name":"biostar2_tna_adv","activated":"false"},{"product_type":"13","name":"biostar2_tna_pro","activated":"false"}],"mobile":{"use_mobile_credential":"1","email":"agni@supremainc.com","password":"****************","mc_server_addr":"https://api.mc.suprema.io","mc_port":"443","siteid":"6482","site_type":"REGULAR"},"log_level":{"enable":"true","log_retain_days":"60","level":"none","filter":{"SYS":"info","DBG":"none","NET":"info","WEB":"info","SQL":"none","WSS":"none"}},"server_ip_list":[{"ip":"192.168.1.5","version":"v4"}],"use_alphanumeric":"false","is_set_new_administrator_password":"false","ischanged_db_data_encryption":"false","ischanged_data_encryption":"false","eventlog":{"event_log_retain_days":"60","active":"false"},"log":{"log_retain_days":"60","cron":"0
            0 0 * * *","path":"logs"}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/biostar' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"BioStar":{"session_timeout":"216000","server_port":"51212","server_matching":{"matching-concurrency-count":2,"use-server-matching":false,"security-level":6,"fast-mode":true,"face-security-level":1},"user_sync_method":1,"user_by_device_sync_method":0,"log_sync_method":0,"check_duplicate_id_at_devices":0,"automatic_server_upgrade":0,"upgrade_when":0,"fingerprint_format":0,"licese_server_addr":"http://license.biostar2.com","backup":{"use":false,"cycle":2,"day":28,"weekday":2,"time":10800,"path":".\\bk","overwritable":"false"},"support_mobile_credential":"true","language":"en","server_addr":"","delete_credential_after_aoc":"false","secure_communication":{"mode":"0","use_external_cert":"false","enable_data_encryption":"false","enable_db_data_encryption":"false","ischanged_data_encryption":"false","ischanged_db_data_encryption":"false","enable_db_encryption":"false","is_random_encryption_key":"true","is_random_hash_key":"true","has_encryption_key":"false","has_hash_key":"true"},"system_security":{"password_strength":"2","use_password_update_cycle":"false","password_update_cycle":"60","use_allow_login_failed":"false","allow_login_failed_count":"5","allow_login_failed_minutes":"10","use_allow_password_change":"false","allow_password_change_count":"1","use_allow_simultaneous_connection":"true"},"web_request_timeout":"60","imglog_dir":".\\imagelog\\","websocket_cors":"*","enable_websocket_connection_bsSessionId":"false","enckey_dir":"C:\\Program
            Files\\BioStar
            2(x64)\\util","device_event_log_skip_enroll_success_user":"false","http":{"port":"80","root_path":"html"},"https":{"use_ssl":"1","port":"443","ssl_addr":"192.168.1.5","server.ssl.key-store-password.use_enc":"1"},"cloud":{"use_cloud":"0","server_address":"api.biostar2.com","http_port":"52000","version":"v2","sub_domain":"oddbit","email":"team-suprema@oddbit.id","account_id":"611dcbe1f3e8e50a179b105c","email_use_enc":"1"},"tna":{"use_tna":"true","http_port":"3000","https_port":"3002","ngrok_port":"51000"},"video":{"use_video":"true","http_port":"3010","https_port":"3012","ngrok_port":"52002"},"licenses":[{"product_type":"1","name":"biostar_def","available":{"ZONE":"false","ELEVATOR":"false","SERVER_MATCHING":"false","CLOUD":"false","MOBILE_CARD":"false","GRAPHICMAP":"false"},"activated":"true"},{"product_type":"2","name":"biostar_std","activated":"false"},{"product_type":"3","name":"biostar_tna","activated":"false"},{"product_type":"4","name":"biostar2_basic","activated":"false"},{"product_type":"5","name":"biostar2_std","activated":"false"},{"product_type":"6","name":"biostar2_adv","available":{"ZONE":"true","ELEVATOR":"true","SERVER_MATCHING":"true","CLOUD":"true","MOBILE_CARD":"true","GRAPHICMAP":"true"},"activated":"true","customer":"Oddbit","expires_on":"permanent"},{"product_type":"7","name":"biostar2_pro","activated":"false"},{"product_type":"8","name":"biostar2_ent","activated":"false"},{"product_type":"9","name":"biostar2_video","activated":"false"},{"product_type":"10","name":"biostar2_visitor","activated":"false"},{"product_type":"11","name":"biostar2_tna_std","activated":"false"},{"product_type":"12","name":"biostar2_tna_adv","activated":"false"},{"product_type":"13","name":"biostar2_tna_pro","activated":"false"}],"mobile":{"use_mobile_credential":"1","email":"agni@supremainc.com","password":"****************","mc_server_addr":"https://api.mc.suprema.io","mc_port":"443","siteid":"6482","site_type":"REGULAR"},"log_level":{"enable":"true","log_retain_days":"60","level":"none","filter":{"SYS":"info","DBG":"none","NET":"info","WEB":"info","SQL":"none","WSS":"none"}},"server_ip_list":[{"ip":"192.168.1.5","version":"v4"}],"use_alphanumeric":"false","is_set_new_administrator_password":"false","ischanged_db_data_encryption":"false","ischanged_data_encryption":"false","eventlog":{"event_log_retain_days":"60","active":"false"},"log":{"log_retain_days":"60","cron":"0
            0 0 * * *","path":"logs"}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/biostar"


            payload <-
            "{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0
            0 0 * * *\",\"path\":\"logs\"}}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/setting/biostar" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0
            0 0 * * *\",\"path\":\"logs\"}}}" in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"BioStar\":{\"session_timeout\":\"216000\",\"server_port\":\"51212\",\"server_matching\":{\"matching-concurrency-count\":2,\"use-server-matching\":false,\"security-level\":6,\"fast-mode\":true,\"face-security-level\":1},\"user_sync_method\":1,\"user_by_device_sync_method\":0,\"log_sync_method\":0,\"check_duplicate_id_at_devices\":0,\"automatic_server_upgrade\":0,\"upgrade_when\":0,\"fingerprint_format\":0,\"licese_server_addr\":\"http://license.biostar2.com\",\"backup\":{\"use\":false,\"cycle\":2,\"day\":28,\"weekday\":2,\"time\":10800,\"path\":\".\\\\bk\",\"overwritable\":\"false\"},\"support_mobile_credential\":\"true\",\"language\":\"en\",\"server_addr\":\"\",\"delete_credential_after_aoc\":\"false\",\"secure_communication\":{\"mode\":\"0\",\"use_external_cert\":\"false\",\"enable_data_encryption\":\"false\",\"enable_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"enable_db_encryption\":\"false\",\"is_random_encryption_key\":\"true\",\"is_random_hash_key\":\"true\",\"has_encryption_key\":\"false\",\"has_hash_key\":\"true\"},\"system_security\":{\"password_strength\":\"2\",\"use_password_update_cycle\":\"false\",\"password_update_cycle\":\"60\",\"use_allow_login_failed\":\"false\",\"allow_login_failed_count\":\"5\",\"allow_login_failed_minutes\":\"10\",\"use_allow_password_change\":\"false\",\"allow_password_change_count\":\"1\",\"use_allow_simultaneous_connection\":\"true\"},\"web_request_timeout\":\"60\",\"imglog_dir\":\".\\\\imagelog\\\\\",\"websocket_cors\":\"*\",\"enable_websocket_connection_bsSessionId\":\"false\",\"enckey_dir\":\"C:\\\\Program
            Files\\\\BioStar
            2(x64)\\\\util\",\"device_event_log_skip_enroll_success_user\":\"false\",\"http\":{\"port\":\"80\",\"root_path\":\"html\"},\"https\":{\"use_ssl\":\"1\",\"port\":\"443\",\"ssl_addr\":\"192.168.1.5\",\"server.ssl.key-store-password.use_enc\":\"1\"},\"cloud\":{\"use_cloud\":\"0\",\"server_address\":\"api.biostar2.com\",\"http_port\":\"52000\",\"version\":\"v2\",\"sub_domain\":\"oddbit\",\"email\":\"team-suprema@oddbit.id\",\"account_id\":\"611dcbe1f3e8e50a179b105c\",\"email_use_enc\":\"1\"},\"tna\":{\"use_tna\":\"true\",\"http_port\":\"3000\",\"https_port\":\"3002\",\"ngrok_port\":\"51000\"},\"video\":{\"use_video\":\"true\",\"http_port\":\"3010\",\"https_port\":\"3012\",\"ngrok_port\":\"52002\"},\"licenses\":[{\"product_type\":\"1\",\"name\":\"biostar_def\",\"available\":{\"ZONE\":\"false\",\"ELEVATOR\":\"false\",\"SERVER_MATCHING\":\"false\",\"CLOUD\":\"false\",\"MOBILE_CARD\":\"false\",\"GRAPHICMAP\":\"false\"},\"activated\":\"true\"},{\"product_type\":\"2\",\"name\":\"biostar_std\",\"activated\":\"false\"},{\"product_type\":\"3\",\"name\":\"biostar_tna\",\"activated\":\"false\"},{\"product_type\":\"4\",\"name\":\"biostar2_basic\",\"activated\":\"false\"},{\"product_type\":\"5\",\"name\":\"biostar2_std\",\"activated\":\"false\"},{\"product_type\":\"6\",\"name\":\"biostar2_adv\",\"available\":{\"ZONE\":\"true\",\"ELEVATOR\":\"true\",\"SERVER_MATCHING\":\"true\",\"CLOUD\":\"true\",\"MOBILE_CARD\":\"true\",\"GRAPHICMAP\":\"true\"},\"activated\":\"true\",\"customer\":\"Oddbit\",\"expires_on\":\"permanent\"},{\"product_type\":\"7\",\"name\":\"biostar2_pro\",\"activated\":\"false\"},{\"product_type\":\"8\",\"name\":\"biostar2_ent\",\"activated\":\"false\"},{\"product_type\":\"9\",\"name\":\"biostar2_video\",\"activated\":\"false\"},{\"product_type\":\"10\",\"name\":\"biostar2_visitor\",\"activated\":\"false\"},{\"product_type\":\"11\",\"name\":\"biostar2_tna_std\",\"activated\":\"false\"},{\"product_type\":\"12\",\"name\":\"biostar2_tna_adv\",\"activated\":\"false\"},{\"product_type\":\"13\",\"name\":\"biostar2_tna_pro\",\"activated\":\"false\"}],\"mobile\":{\"use_mobile_credential\":\"1\",\"email\":\"agni@supremainc.com\",\"password\":\"****************\",\"mc_server_addr\":\"https://api.mc.suprema.io\",\"mc_port\":\"443\",\"siteid\":\"6482\",\"site_type\":\"REGULAR\"},\"log_level\":{\"enable\":\"true\",\"log_retain_days\":\"60\",\"level\":\"none\",\"filter\":{\"SYS\":\"info\",\"DBG\":\"none\",\"NET\":\"info\",\"WEB\":\"info\",\"SQL\":\"none\",\"WSS\":\"none\"}},\"server_ip_list\":[{\"ip\":\"192.168.1.5\",\"version\":\"v4\"}],\"use_alphanumeric\":\"false\",\"is_set_new_administrator_password\":\"false\",\"ischanged_db_data_encryption\":\"false\",\"ischanged_data_encryption\":\"false\",\"eventlog\":{\"event_log_retain_days\":\"60\",\"active\":\"false\"},\"log\":{\"log_retain_days\":\"60\",\"cron\":\"0
            0 0 * * *\",\"path\":\"logs\"}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/biostar")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users/next_user_id:
    get:
      tags:
        - Create User
      summary: 03 Find Next Available UserID
      operationId: getUserNextUserId
      description: >-
        After User ID setting of BioStar X is confirmed, use this API to get the
        next `user_id` for new user.


        This API will only shows next available ID in number format.


        Keep this ID for input on `user_id` parameter when creating new user.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/users/next_user_id \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/users/next_user_id \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/users/next_user_id
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/next_user_id",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/users/next_user_id',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/users/next_user_id");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/users/next_user_id',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/users/next_user_id';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/users/next_user_id', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/next_user_id",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/users/next_user_id");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/users/next_user_id",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/users/next_user_id"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/users/next_user_id")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/next_user_id",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/users/next_user_id');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/users/next_user_id');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/next_user_id")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/users/next_user_id")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/next_user_id\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/next_user_id");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/next_user_id"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/next_user_id")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/next_user_id");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/users/next_user_id"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/next_user_id' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/next_user_id' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/next_user_id"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/users/next_user_id"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/next_user_id")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/users/{id}:
    put:
      tags:
        - User
      summary: Update User Fingerprint Credentials
      operationId: updateUserFingerprint
      description: >-
        This API is used to update fingerprint data on a User.


        Use `POST /api/devices/{dev_id}/scan_fingerprint` to enroll fingerprint.

        Use `POST /api/server_matching/identify_finger` to check whether the
        fingerprint already recorded or not.


        **Important Notes:**

        - Raw data for template0 and template1 available after enrolling a
        fingerprint

        - Fingerprint(s) used for regular access should not be registered as
        duress fingerprint

        - If the fingerprint authentication rate is low, delete the existing
        fingerprint information and add a new fingerprint

        - Use an adequate security level. If 1:1 Security Level is too high, the
        fingerprint authentication rate may be too low or the false rejection
        rate (FRR) may be too high

        - For best fingerprint scanning quality, make sure to cover the entire
        surface of the fingerprint sensor with the finger
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserFingerprintUpdateInput'
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the user to update fingerprint credentials
          example: 14
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/users/14 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"User":{"fingerprint_templates":[{"finger_mask":false,"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=","isNew":true}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"User":{"fingerprint_templates":[{"finger_mask":false,"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=","isNew":true}]}}'
            |  \
              http PUT https://{baseurl}/api/users/14 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"User":{"fingerprint_templates":[{"finger_mask":false,"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=","isNew":true}]}}' \
              --output-document \
              - https://{baseurl}/api/users/14
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/14",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              User: {
                fingerprint_templates: [
                  {
                    finger_mask: false,
                    template0: 'RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///',
                    template1: 'RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=',
                    isNew: true
                  }
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/users/14',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                User: {
                  fingerprint_templates: [
                    {
                      finger_mask: false,
                      template0: 'RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///',
                      template1: 'RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=',
                      isNew: true
                    }
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/users/14");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "User": {
                "fingerprint_templates": [
                  {
                    "finger_mask": false,
                    "template0": "RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///",
                    "template1": "RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=",
                    "isNew": true
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/users/14',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                User: {
                  fingerprint_templates: [
                    {
                      finger_mask: false,
                      template0: 'RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///',
                      template1: 'RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=',
                      isNew: true
                    }
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/users/14';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"User":{"fingerprint_templates":[{"finger_mask":false,"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=","isNew":true}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"User":{"fingerprint_templates":[{"finger_mask":false,"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=","isNew":true}]}}'
            };

            fetch('https://{baseurl}/api/users/14', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/14",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "User": {
                "fingerprint_templates": [
                  {
                    "finger_mask": false,
                    "template0": "RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///",
                    "template1": "RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=",
                    "isNew": true
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/users/14");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/users/14", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/14"


            payload = {"User": {"fingerprint_templates": [
                        {
                            "finger_mask": False,
                            "template0": "RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///",
                            "template1": "RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=",
                            "isNew": True
                        }
                    ]}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/users/14")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/14",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/14');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"User":{"fingerprint_templates":[{"finger_mask":false,"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=","isNew":true}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"User":{"fingerprint_templates":[{"finger_mask":false,"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=","isNew":true}]}}');


            $request->setRequestUrl('https://{baseurl}/api/users/14');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/14")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/users/14")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/14\"\n\n\tpayload := strings.NewReader(\"{\\\"User\\\":{\\\"fingerprint_templates\\\":[{\\\"finger_mask\\\":false,\\\"template0\\\":\\\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\\\",\\\"template1\\\":\\\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\\\",\\\"isNew\\\":true}]}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/14");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"User": @{ @"fingerprint_templates":
            @[ @{ @"finger_mask": @NO, @"template0":
            @"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///",
            @"template1":
            @"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=",
            @"isNew": @YES } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/14"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["User": ["fingerprint_templates": [
                  [
                    "finger_mask": false,
                    "template0": "RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///",
                    "template1": "RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=",
                    "isNew": true
                  ]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/14")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/users/14");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/users/14"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/users/14'
            -Method PUT -Headers $headers -ContentType 'application/json' -Body
            '{"User":{"fingerprint_templates":[{"finger_mask":false,"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=","isNew":true}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/users/14'
            -Method PUT -Headers $headers -ContentType 'application/json' -Body
            '{"User":{"fingerprint_templates":[{"finger_mask":false,"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=","isNew":true}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/14"


            payload <-
            "{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/users/14" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"User\":{\"fingerprint_templates\":[{\"finger_mask\":false,\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\",\"isNew\":true}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/14")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - User
      summary: View a User's Details
      operationId: viewUserDetails
      description: >-
        This API is used to view a user's details which is recorded on BioStar
        X.


        **Known errors:**

        - Putting "/" at the end of the endpoint
            
        - Using User ID which doesn't exist
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the User
          example: '{{iterIDVal}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/users/{{iterIDVal}} \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/users/{{iterIDVal}} \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/users/{{iterIDVal}}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/{{iterIDVal}}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/users/{{iterIDVal}}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/users/{{iterIDVal}}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/users/{{iterIDVal}}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/users/{{iterIDVal}}';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/users/{{iterIDVal}}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/{{iterIDVal}}",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/users/{{iterIDVal}}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/users/{{iterIDVal}}",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/users/{{iterIDVal}}"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/users/{{iterIDVal}}")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/{{iterIDVal}}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/users/{{iterIDVal}}');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/users/{{iterIDVal}}');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/{{iterIDVal}}")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/users/{{iterIDVal}}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/{{iterIDVal}}\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/{{iterIDVal}}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/{{iterIDVal}}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/{{iterIDVal}}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/{{iterIDVal}}");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/users/{{iterIDVal}}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/{{iterIDVal}}' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/{{iterIDVal}}' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/{{iterIDVal}}"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/users/{{iterIDVal}}"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/{{iterIDVal}}")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/users/bulk:
    put:
      tags:
        - User
      summary: 'User: Bulk Update'
      operationId: updateUserBulk
      description: >-
        This API is used for updating user information in bulk.


        The difference of this API and `/api/users?id=1+2+3` is that this API
        can update different data of many users at the same time.


        **Warning:** The maximum number of users that can be modified in a
        single API call is **100**.


        **Response Codes:**

        - **ret_code** presents BioStar X response code for modifying each user

        - Response.code could be `0` (Overall success), `1` (Partial success),
        `8` (Overall failed)

        - For error code meanings, refer to `[BioStar X Install
        Path]\nginx\html\resources\messages_en`
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserBulkUpdateInput'
      responses:
        '200':
          description: Bulk update completed (success, partial success, or failed)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserBulkUpdateResponse'
        '400':
          description: Bad request - Invalid JSON data or parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse700'
        '500':
          description: >-
            500 Internal Server Error - An unexpected error occurred on the
            server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/users/bulk \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"UserCollection":{"rows":[{"user_id":"9","name":"John Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"SW1_00003@gmail.com","department":"Engineering","user_title":"Manager","login_id":"myloginid","password":"zlwRzi7Kcpi1kiQ","user_ip":"191.59.135.73"}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"UserCollection":{"rows":[{"user_id":"9","name":"John
            Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"SW1_00003@gmail.com","department":"Engineering","user_title":"Manager","login_id":"myloginid","password":"zlwRzi7Kcpi1kiQ","user_ip":"191.59.135.73"}]}}'
            |  \
              http PUT https://{baseurl}/api/users/bulk \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"UserCollection":{"rows":[{"user_id":"9","name":"John Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"SW1_00003@gmail.com","department":"Engineering","user_title":"Manager","login_id":"myloginid","password":"zlwRzi7Kcpi1kiQ","user_ip":"191.59.135.73"}]}}' \
              --output-document \
              - https://{baseurl}/api/users/bulk
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/bulk",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              UserCollection: {
                rows: [
                  {
                    user_id: '9',
                    name: 'John Doe',
                    user_group_id: {id: '1'},
                    disabled: false,
                    start_datetime: '2001-01-01T00:00:00.00Z',
                    expiry_datetime: '2030-12-31T23:59:00.00Z',
                    email: 'SW1_00003@gmail.com',
                    department: 'Engineering',
                    user_title: 'Manager',
                    login_id: 'myloginid',
                    password: 'zlwRzi7Kcpi1kiQ',
                    user_ip: '191.59.135.73'
                  }
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/users/bulk',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                UserCollection: {
                  rows: [
                    {
                      user_id: '9',
                      name: 'John Doe',
                      user_group_id: {id: '1'},
                      disabled: false,
                      start_datetime: '2001-01-01T00:00:00.00Z',
                      expiry_datetime: '2030-12-31T23:59:00.00Z',
                      email: 'SW1_00003@gmail.com',
                      department: 'Engineering',
                      user_title: 'Manager',
                      login_id: 'myloginid',
                      password: 'zlwRzi7Kcpi1kiQ',
                      user_ip: '191.59.135.73'
                    }
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/users/bulk");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "UserCollection": {
                "rows": [
                  {
                    "user_id": "9",
                    "name": "John Doe",
                    "user_group_id": {
                      "id": "1"
                    },
                    "disabled": false,
                    "start_datetime": "2001-01-01T00:00:00.00Z",
                    "expiry_datetime": "2030-12-31T23:59:00.00Z",
                    "email": "SW1_00003@gmail.com",
                    "department": "Engineering",
                    "user_title": "Manager",
                    "login_id": "myloginid",
                    "password": "zlwRzi7Kcpi1kiQ",
                    "user_ip": "191.59.135.73"
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/users/bulk',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                UserCollection: {
                  rows: [
                    {
                      user_id: '9',
                      name: 'John Doe',
                      user_group_id: {id: '1'},
                      disabled: false,
                      start_datetime: '2001-01-01T00:00:00.00Z',
                      expiry_datetime: '2030-12-31T23:59:00.00Z',
                      email: 'SW1_00003@gmail.com',
                      department: 'Engineering',
                      user_title: 'Manager',
                      login_id: 'myloginid',
                      password: 'zlwRzi7Kcpi1kiQ',
                      user_ip: '191.59.135.73'
                    }
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/users/bulk';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"UserCollection":{"rows":[{"user_id":"9","name":"John Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"SW1_00003@gmail.com","department":"Engineering","user_title":"Manager","login_id":"myloginid","password":"zlwRzi7Kcpi1kiQ","user_ip":"191.59.135.73"}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"UserCollection":{"rows":[{"user_id":"9","name":"John Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"SW1_00003@gmail.com","department":"Engineering","user_title":"Manager","login_id":"myloginid","password":"zlwRzi7Kcpi1kiQ","user_ip":"191.59.135.73"}]}}'
            };

            fetch('https://{baseurl}/api/users/bulk', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/bulk",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "UserCollection": {
                "rows": [
                  {
                    "user_id": "9",
                    "name": "John Doe",
                    "user_group_id": {
                      "id": "1"
                    },
                    "disabled": false,
                    "start_datetime": "2001-01-01T00:00:00.00Z",
                    "expiry_datetime": "2030-12-31T23:59:00.00Z",
                    "email": "SW1_00003@gmail.com",
                    "department": "Engineering",
                    "user_title": "Manager",
                    "login_id": "myloginid",
                    "password": "zlwRzi7Kcpi1kiQ",
                    "user_ip": "191.59.135.73"
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/users/bulk");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/users/bulk", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/bulk"


            payload = {"UserCollection": {"rows": [
                        {
                            "user_id": "9",
                            "name": "John Doe",
                            "user_group_id": {"id": "1"},
                            "disabled": False,
                            "start_datetime": "2001-01-01T00:00:00.00Z",
                            "expiry_datetime": "2030-12-31T23:59:00.00Z",
                            "email": "SW1_00003@gmail.com",
                            "department": "Engineering",
                            "user_title": "Manager",
                            "login_id": "myloginid",
                            "password": "zlwRzi7Kcpi1kiQ",
                            "user_ip": "191.59.135.73"
                        }
                    ]}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/users/bulk")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/bulk",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/bulk');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"UserCollection":{"rows":[{"user_id":"9","name":"John
            Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"SW1_00003@gmail.com","department":"Engineering","user_title":"Manager","login_id":"myloginid","password":"zlwRzi7Kcpi1kiQ","user_ip":"191.59.135.73"}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"UserCollection":{"rows":[{"user_id":"9","name":"John
            Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"SW1_00003@gmail.com","department":"Engineering","user_title":"Manager","login_id":"myloginid","password":"zlwRzi7Kcpi1kiQ","user_ip":"191.59.135.73"}]}}');


            $request->setRequestUrl('https://{baseurl}/api/users/bulk');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/bulk")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/users/bulk")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/bulk\"\n\n\tpayload := strings.NewReader(\"{\\\"UserCollection\\\":{\\\"rows\\\":[{\\\"user_id\\\":\\\"9\\\",\\\"name\\\":\\\"John Doe\\\",\\\"user_group_id\\\":{\\\"id\\\":\\\"1\\\"},\\\"disabled\\\":false,\\\"start_datetime\\\":\\\"2001-01-01T00:00:00.00Z\\\",\\\"expiry_datetime\\\":\\\"2030-12-31T23:59:00.00Z\\\",\\\"email\\\":\\\"SW1_00003@gmail.com\\\",\\\"department\\\":\\\"Engineering\\\",\\\"user_title\\\":\\\"Manager\\\",\\\"login_id\\\":\\\"myloginid\\\",\\\"password\\\":\\\"zlwRzi7Kcpi1kiQ\\\",\\\"user_ip\\\":\\\"191.59.135.73\\\"}]}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/bulk");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"UserCollection": @{ @"rows": @[ @{
            @"user_id": @"9", @"name": @"John Doe", @"user_group_id": @{ @"id":
            @"1" }, @"disabled": @NO, @"start_datetime":
            @"2001-01-01T00:00:00.00Z", @"expiry_datetime":
            @"2030-12-31T23:59:00.00Z", @"email": @"SW1_00003@gmail.com",
            @"department": @"Engineering", @"user_title": @"Manager",
            @"login_id": @"myloginid", @"password": @"zlwRzi7Kcpi1kiQ",
            @"user_ip": @"191.59.135.73" } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/bulk"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["UserCollection": ["rows": [
                  [
                    "user_id": "9",
                    "name": "John Doe",
                    "user_group_id": ["id": "1"],
                    "disabled": false,
                    "start_datetime": "2001-01-01T00:00:00.00Z",
                    "expiry_datetime": "2030-12-31T23:59:00.00Z",
                    "email": "SW1_00003@gmail.com",
                    "department": "Engineering",
                    "user_title": "Manager",
                    "login_id": "myloginid",
                    "password": "zlwRzi7Kcpi1kiQ",
                    "user_ip": "191.59.135.73"
                  ]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/bulk")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/users/bulk");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/users/bulk"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/bulk' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"UserCollection":{"rows":[{"user_id":"9","name":"John
            Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"SW1_00003@gmail.com","department":"Engineering","user_title":"Manager","login_id":"myloginid","password":"zlwRzi7Kcpi1kiQ","user_ip":"191.59.135.73"}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/bulk' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"UserCollection":{"rows":[{"user_id":"9","name":"John
            Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"SW1_00003@gmail.com","department":"Engineering","user_title":"Manager","login_id":"myloginid","password":"zlwRzi7Kcpi1kiQ","user_ip":"191.59.135.73"}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/bulk"


            payload <-
            "{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/users/bulk" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"UserCollection\":{\"rows\":[{\"user_id\":\"9\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"SW1_00003@gmail.com\",\"department\":\"Engineering\",\"user_title\":\"Manager\",\"login_id\":\"myloginid\",\"password\":\"zlwRzi7Kcpi1kiQ\",\"user_ip\":\"191.59.135.73\"}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/bulk")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users/check/upload_picture:
    put:
      tags:
        - User
      summary: Check Picture Specification
      operationId: updateUserCheckUploadPicture
      description: >-
        This API is used to check whether the image that will be uploaded on
        Visual Face credential is according to specification or not.


        - Supported image file size is up to 10MB.

        - Supported image file formats are JPG, JPEG and PNG.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                template_ex_picture:
                  type: string
                  format: byte
                  description: Image that will be checked (base64 encoded)
                  example: >-
                    /9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/users/check/upload_picture \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"template_ex_picture":"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"template_ex_picture":"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"}'
            |  \
              http PUT https://{baseurl}/api/users/check/upload_picture \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"template_ex_picture":"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"}' \
              --output-document \
              - https://{baseurl}/api/users/check/upload_picture
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/check/upload_picture",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              template_ex_picture: '/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z'
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/users/check/upload_picture',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                template_ex_picture: '/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z'
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/users/check/upload_picture");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "template_ex_picture": "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/users/check/upload_picture',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                template_ex_picture: '/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z'
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/users/check/upload_picture';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"template_ex_picture":"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"template_ex_picture":"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"}'
            };

            fetch('https://{baseurl}/api/users/check/upload_picture', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/check/upload_picture",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "template_ex_picture": "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/users/check/upload_picture");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/users/check/upload_picture",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/check/upload_picture"


            payload = {"template_ex_picture":
            "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/users/check/upload_picture")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/check/upload_picture",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/check/upload_picture');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"template_ex_picture":"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"template_ex_picture":"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"}');


            $request->setRequestUrl('https://{baseurl}/api/users/check/upload_picture');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/check/upload_picture")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/users/check/upload_picture")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/check/upload_picture\"\n\n\tpayload := strings.NewReader(\"{\\\"template_ex_picture\\\":\\\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\\\"}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/check/upload_picture");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"template_ex_picture":
            @"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"
            };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/check/upload_picture"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["template_ex_picture":
            "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"]
            as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/check/upload_picture")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/check/upload_picture");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/users/check/upload_picture"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/check/upload_picture' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"template_ex_picture":"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/check/upload_picture' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"template_ex_picture":"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/check/upload_picture"


            payload <-
            "{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/users/check/upload_picture" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"template_ex_picture\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwBVD//Z\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/check/upload_picture")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users/advance_search/delete:
    post:
      tags:
        - User
      summary: Delete User(s) with Advanced Search
      operationId: searchUserAdvanceSearchdelete
      description: >-
        This API is used to delete user(s) which is collected from Advanced
        Search query.


        Users matching the advanced search criteria will be deleted from the
        system.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAdvancedSearchDeleteInput'
      parameters:
        - name: adv
          in: query
          schema:
            type: string
          required: true
          description: Use this to enable Advanced Search query result
          example: mode1
      responses:
        '200':
          description: Users deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/users/advance_search/delete?adv=mode1' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
            |  \
              http POST 'https://{baseurl}/api/users/advance_search/delete?adv=mode1' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}' \
              --output-document \
              - 'https://{baseurl}/api/users/advance_search/delete?adv=mode1'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/advance_search/delete?adv=mode1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              adv_criteria: {
                limit: 50,
                offset: 0,
                user_id: '11',
                order_by: 'user_id:false',
                user_group_id: 1,
                user_group_ids: [1121],
                user_name: 'John',
                user_email: 'abc@gmail.com',
                user_phone: '123-456-7890',
                user_access_group_ids: '17,18',
                user_operator_level_id: 0,
                user_department: 'Engineering',
                user_title: 'Manager',
                user_card: '123456',
                user_custom_field_1: 'string',
                user_custom_field_2: 'string',
                user_custom_field_3: 'string',
                user_custom_field_4: 'string',
                user_custom_field_5: 'string',
                user_custom_field_6: 'string',
                user_custom_field_7: 'string',
                user_custom_field_8: 'string',
                user_custom_field_9: 'string',
                user_custom_field_10: 'string',
                user_status: false
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/advance_search/delete',
              qs: {adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                adv_criteria: {
                  limit: 50,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/users/advance_search/delete");


            req.query({
              "adv": "mode1"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "adv_criteria": {
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/advance_search/delete',
              params: {adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                adv_criteria: {
                  limit: 50,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/users/advance_search/delete?adv=mode1';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
            };


            fetch('https://{baseurl}/api/users/advance_search/delete?adv=mode1',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/advance_search/delete?adv=mode1",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "adv_criteria": {
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/users/advance_search/delete?adv=mode1");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/users/advance_search/delete?adv=mode1", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/advance_search/delete"


            querystring = {"adv":"mode1"}


            payload = {"adv_criteria": {
                    "limit": 50,
                    "offset": 0,
                    "user_id": "11",
                    "order_by": "user_id:false",
                    "user_group_id": 1,
                    "user_group_ids": [1121],
                    "user_name": "John",
                    "user_email": "abc@gmail.com",
                    "user_phone": "123-456-7890",
                    "user_access_group_ids": "17,18",
                    "user_operator_level_id": 0,
                    "user_department": "Engineering",
                    "user_title": "Manager",
                    "user_card": "123456",
                    "user_custom_field_1": "string",
                    "user_custom_field_2": "string",
                    "user_custom_field_3": "string",
                    "user_custom_field_4": "string",
                    "user_custom_field_5": "string",
                    "user_custom_field_6": "string",
                    "user_custom_field_7": "string",
                    "user_custom_field_8": "string",
                    "user_custom_field_9": "string",
                    "user_custom_field_10": "string",
                    "user_status": False
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/users/advance_search/delete?adv=mode1")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/advance_search/delete?adv=mode1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/advance_search/delete');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'adv' => 'mode1'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}');


            $request->setRequestUrl('https://{baseurl}/api/users/advance_search/delete');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'adv' => 'mode1'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/advance_search/delete?adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/users/advance_search/delete?adv=mode1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/advance_search/delete?adv=mode1\"\n\n\tpayload := strings.NewReader(\"{\\\"adv_criteria\\\":{\\\"limit\\\":50,\\\"offset\\\":0,\\\"user_id\\\":\\\"11\\\",\\\"order_by\\\":\\\"user_id:false\\\",\\\"user_group_id\\\":1,\\\"user_group_ids\\\":[1121],\\\"user_name\\\":\\\"John\\\",\\\"user_email\\\":\\\"abc@gmail.com\\\",\\\"user_phone\\\":\\\"123-456-7890\\\",\\\"user_access_group_ids\\\":\\\"17,18\\\",\\\"user_operator_level_id\\\":0,\\\"user_department\\\":\\\"Engineering\\\",\\\"user_title\\\":\\\"Manager\\\",\\\"user_card\\\":\\\"123456\\\",\\\"user_custom_field_1\\\":\\\"string\\\",\\\"user_custom_field_2\\\":\\\"string\\\",\\\"user_custom_field_3\\\":\\\"string\\\",\\\"user_custom_field_4\\\":\\\"string\\\",\\\"user_custom_field_5\\\":\\\"string\\\",\\\"user_custom_field_6\\\":\\\"string\\\",\\\"user_custom_field_7\\\":\\\"string\\\",\\\"user_custom_field_8\\\":\\\"string\\\",\\\"user_custom_field_9\\\":\\\"string\\\",\\\"user_custom_field_10\\\":\\\"string\\\",\\\"user_status\\\":false}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/advance_search/delete?adv=mode1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"adv_criteria": @{ @"limit": @50,
            @"offset": @0, @"user_id": @"11", @"order_by": @"user_id:false",
            @"user_group_id": @1, @"user_group_ids": @[ @1121 ], @"user_name":
            @"John", @"user_email": @"abc@gmail.com", @"user_phone":
            @"123-456-7890", @"user_access_group_ids": @"17,18",
            @"user_operator_level_id": @0, @"user_department": @"Engineering",
            @"user_title": @"Manager", @"user_card": @"123456",
            @"user_custom_field_1": @"string", @"user_custom_field_2":
            @"string", @"user_custom_field_3": @"string",
            @"user_custom_field_4": @"string", @"user_custom_field_5":
            @"string", @"user_custom_field_6": @"string",
            @"user_custom_field_7": @"string", @"user_custom_field_8":
            @"string", @"user_custom_field_9": @"string",
            @"user_custom_field_10": @"string", @"user_status": @NO } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/advance_search/delete?adv=mode1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["adv_criteria": [
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [1121],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/advance_search/delete?adv=mode1")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/advance_search/delete?adv=mode1");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/users/advance_search/delete?adv=mode1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/advance_search/delete?adv=mode1'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/advance_search/delete?adv=mode1'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/advance_search/delete"


            queryString <- list([ 'adv' ] = "mode1")


            payload <-
            "{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/users/advance_search/delete?adv=mode1" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/advance_search/delete?adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users/export:
    post:
      tags:
        - User
      summary: Send User Data to Device
      operationId: exportUserExport
      description: >-
        This API is used to send user data to a device.

        For example when you want to send user John data after credential update
        to FaceStation F2.

        **Notes:**

        - Set `adv=mode1` on Query Parameter to enable advanced search
        compatibility. This parameter is optional. When not used, it will use
        the previous capability.

        - Maximum of 100 users can be processed in a single request

        - Request Body with Advanced Search example (see **Batch Edit with
        Advanced Search** for `adv_criteria` details)


        ```json

        {
          "DeviceCollection" : {
            "rows" : [ {
              "id" : "50362288"
            } ]
          },
          "adv_criteria" : {
            "limit" : 50,
            "order_by" : "user_id:false",
            "user_group_ids" : [ 1014 ],
            "user_id" : "8",
            "user_email" : "support@supremainc.com"
          }
        }

        ```
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/UserExportInput'
                - $ref: '#/components/schemas/UserExportAdvancedInput'
      parameters:
        - name: overwrite
          in: query
          schema:
            type: boolean
          description: >
            Toggle to overwrite the data on the device. True to overwrite
            (default value)
          example: true
        - name: id
          in: query
          schema:
            type: integer
          description: >-
            ID of the User that will be sent to the Device. To send multiple
            users, use plus (+) sign as separator of each User ID. Ex:
            1001+1002+1003+1004
          example: 15
        - name: adv
          in: query
          schema:
            type: string
          description: Use this to enable Advanced Search query result.
          example: mode1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserExportResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DeviceCollection":{"rows":[{"id":"50362288"}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"DeviceCollection":{"rows":[{"id":"50362288"}]}}' |  \
              http POST 'https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DeviceCollection":{"rows":[{"id":"50362288"}]}}' \
              --output-document \
              - 'https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1'
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({DeviceCollection: {rows: [{id:
            '50362288'}]}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/export',
              qs: {overwrite: 'true', id: '15', adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DeviceCollection: {rows: [{id: '50362288'}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/users/export");

            req.query({
              "overwrite": "true",
              "id": "15",
              "adv": "mode1"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": "50362288"
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/export',
              params: {overwrite: 'true', id: '15', adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DeviceCollection: {rows: [{id: '50362288'}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":"50362288"}]}}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":"50362288"}]}}'
            };


            fetch('https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": "50362288"
                  }
                ]
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/export"


            querystring = {"overwrite":"true","id":"15","adv":"mode1"}


            payload = {"DeviceCollection": {"rows": [{"id": "50362288"}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/export');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'overwrite' => 'true',
              'id' => '15',
              'adv' => 'mode1'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"DeviceCollection":{"rows":[{"id":"50362288"}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"DeviceCollection":{"rows":[{"id":"50362288"}]}}');

            $request->setRequestUrl('https://{baseurl}/api/users/export');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setQuery(new http\QueryString([
              'overwrite' => 'true',
              'id' => '15',
              'adv' => 'mode1'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1\"\n\n\tpayload := strings.NewReader(\"{\\\"DeviceCollection\\\":{\\\"rows\\\":[{\\\"id\\\":\\\"50362288\\\"}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DeviceCollection": @{ @"rows": @[ @{
            @"id": @"50362288" } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DeviceCollection": ["rows": [["id":
            "50362288"]]]] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":"50362288"}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":"50362288"}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/export"


            queryString <- list(
              overwrite = "true",
              id = "15"
              adv = "mode1",
            )


            payload <-
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"50362288\"}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/export?overwrite=true&id=15&adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users/remove:
    post:
      tags:
        - User
      summary: Delete User(s) From Device (Advanced Search)
      operationId: createUserRemove
      description: >-
        This API is used to delete user data from device(s) based on Advanced
        Search query results.

        Users matching the advanced search criteria will have their data removed
        from the specified devices.

        **Notes:**

        - Requires `adv=mode1` query parameter to enable advanced search
        functionality

        - Only user data is removed from devices, not from the BioStar X
        database
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserRemoveFromDeviceInput'
      parameters:
        - name: adv
          in: query
          schema:
            type: string
          description: Use this to enable Advanced Search query result.
          example: mode1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDeviceOperationResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/users/remove?adv=mode1' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DeviceCollection":{"rows":[{"id":"40000701"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"DeviceCollection":{"rows":[{"id":"40000701"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
            |  \
              http POST 'https://{baseurl}/api/users/remove?adv=mode1' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DeviceCollection":{"rows":[{"id":"40000701"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}' \
              --output-document \
              - 'https://{baseurl}/api/users/remove?adv=mode1'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/remove?adv=mode1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              DeviceCollection: {rows: [{id: '40000701'}]},
              adv_criteria: {
                limit: 50,
                offset: 0,
                user_id: '11',
                order_by: 'user_id:false',
                user_group_id: 1,
                user_group_ids: [1121],
                user_name: 'John',
                user_email: 'abc@gmail.com',
                user_phone: '123-456-7890',
                user_access_group_ids: '17,18',
                user_operator_level_id: 0,
                user_department: 'Engineering',
                user_title: 'Manager',
                user_card: '123456',
                user_custom_field_1: 'string',
                user_custom_field_2: 'string',
                user_custom_field_3: 'string',
                user_custom_field_4: 'string',
                user_custom_field_5: 'string',
                user_custom_field_6: 'string',
                user_custom_field_7: 'string',
                user_custom_field_8: 'string',
                user_custom_field_9: 'string',
                user_custom_field_10: 'string',
                user_status: false
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/remove',
              qs: {adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                DeviceCollection: {rows: [{id: '40000701'}]},
                adv_criteria: {
                  limit: 50,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/users/remove");

            req.query({
              "adv": "mode1"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": "40000701"
                  }
                ]
              },
              "adv_criteria": {
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/remove',
              params: {adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                DeviceCollection: {rows: [{id: '40000701'}]},
                adv_criteria: {
                  limit: 50,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/users/remove?adv=mode1';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":"40000701"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":"40000701"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
            };

            fetch('https://{baseurl}/api/users/remove?adv=mode1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/remove?adv=mode1",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": "40000701"
                  }
                ]
              },
              "adv_criteria": {
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/users/remove?adv=mode1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/users/remove?adv=mode1",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/remove"


            querystring = {"adv":"mode1"}


            payload = {
                "DeviceCollection": {"rows": [{"id": "40000701"}]},
                "adv_criteria": {
                    "limit": 50,
                    "offset": 0,
                    "user_id": "11",
                    "order_by": "user_id:false",
                    "user_group_id": 1,
                    "user_group_ids": [1121],
                    "user_name": "John",
                    "user_email": "abc@gmail.com",
                    "user_phone": "123-456-7890",
                    "user_access_group_ids": "17,18",
                    "user_operator_level_id": 0,
                    "user_department": "Engineering",
                    "user_title": "Manager",
                    "user_card": "123456",
                    "user_custom_field_1": "string",
                    "user_custom_field_2": "string",
                    "user_custom_field_3": "string",
                    "user_custom_field_4": "string",
                    "user_custom_field_5": "string",
                    "user_custom_field_6": "string",
                    "user_custom_field_7": "string",
                    "user_custom_field_8": "string",
                    "user_custom_field_9": "string",
                    "user_custom_field_10": "string",
                    "user_status": False
                }
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/users/remove?adv=mode1")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/remove?adv=mode1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/remove');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'adv' => 'mode1'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"DeviceCollection":{"rows":[{"id":"40000701"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"DeviceCollection":{"rows":[{"id":"40000701"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}');


            $request->setRequestUrl('https://{baseurl}/api/users/remove');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'adv' => 'mode1'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/remove?adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/users/remove?adv=mode1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/remove?adv=mode1\"\n\n\tpayload := strings.NewReader(\"{\\\"DeviceCollection\\\":{\\\"rows\\\":[{\\\"id\\\":\\\"40000701\\\"}]},\\\"adv_criteria\\\":{\\\"limit\\\":50,\\\"offset\\\":0,\\\"user_id\\\":\\\"11\\\",\\\"order_by\\\":\\\"user_id:false\\\",\\\"user_group_id\\\":1,\\\"user_group_ids\\\":[1121],\\\"user_name\\\":\\\"John\\\",\\\"user_email\\\":\\\"abc@gmail.com\\\",\\\"user_phone\\\":\\\"123-456-7890\\\",\\\"user_access_group_ids\\\":\\\"17,18\\\",\\\"user_operator_level_id\\\":0,\\\"user_department\\\":\\\"Engineering\\\",\\\"user_title\\\":\\\"Manager\\\",\\\"user_card\\\":\\\"123456\\\",\\\"user_custom_field_1\\\":\\\"string\\\",\\\"user_custom_field_2\\\":\\\"string\\\",\\\"user_custom_field_3\\\":\\\"string\\\",\\\"user_custom_field_4\\\":\\\"string\\\",\\\"user_custom_field_5\\\":\\\"string\\\",\\\"user_custom_field_6\\\":\\\"string\\\",\\\"user_custom_field_7\\\":\\\"string\\\",\\\"user_custom_field_8\\\":\\\"string\\\",\\\"user_custom_field_9\\\":\\\"string\\\",\\\"user_custom_field_10\\\":\\\"string\\\",\\\"user_status\\\":false}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/remove?adv=mode1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DeviceCollection": @{ @"rows": @[ @{
            @"id": @"40000701" } ] },
                                          @"adv_criteria": @{ @"limit": @50, @"offset": @0, @"user_id": @"11", @"order_by": @"user_id:false", @"user_group_id": @1, @"user_group_ids": @[ @1121 ], @"user_name": @"John", @"user_email": @"abc@gmail.com", @"user_phone": @"123-456-7890", @"user_access_group_ids": @"17,18", @"user_operator_level_id": @0, @"user_department": @"Engineering", @"user_title": @"Manager", @"user_card": @"123456", @"user_custom_field_1": @"string", @"user_custom_field_2": @"string", @"user_custom_field_3": @"string", @"user_custom_field_4": @"string", @"user_custom_field_5": @"string", @"user_custom_field_6": @"string", @"user_custom_field_7": @"string", @"user_custom_field_8": @"string", @"user_custom_field_9": @"string", @"user_custom_field_10": @"string", @"user_status": @NO } };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/remove?adv=mode1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "DeviceCollection": ["rows": [["id": "40000701"]]],
              "adv_criteria": [
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [1121],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              ]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/remove?adv=mode1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/remove?adv=mode1");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/users/remove?adv=mode1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/remove?adv=mode1' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":"40000701"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/remove?adv=mode1' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":"40000701"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/remove"


            queryString <- list([ 'adv' ] = "mode1")


            payload <-
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/users/remove?adv=mode1" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40000701\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/remove?adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users/absence:
    post:
      tags:
        - User
      summary: List Idle Users - Multiple ID
      operationId: createUserAbsence
      description: >-
        This API shows a workaround using this API to get multiple users data by
        adjusting the parameters.


        The advantage of this workaround is that the API response can be
        adjusted to only show only the required users directly.


        * Query parameter search_month value is set to 0 or removed

        * Body parameter conditions:column value set to user_id, :operator value
        to 2 (contains), and :value can specify multiple user id which uses
        comma as separator.


        For BODY Parameter details refer to POST List Idle Users.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAbsenceQueryInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/users/absence \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
            |  \
              http POST https://{baseurl}/api/users/absence \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}' \
              --output-document \
              - https://{baseurl}/api/users/absence
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/absence",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Query: {
                offset: 0,
                limit: 0,
                conditions: [{column: 'user_id', operator: 2, values: [1, 2, 4]}],
                orders: [{column: 'user_id', descending: false}]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/absence',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Query: {
                  offset: 0,
                  limit: 0,
                  conditions: [{column: 'user_id', operator: 2, values: [1, 2, 4]}],
                  orders: [{column: 'user_id', descending: false}]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/users/absence");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Query": {
                "offset": 0,
                "limit": 0,
                "conditions": [
                  {
                    "column": "user_id",
                    "operator": 2,
                    "values": [
                      1,
                      2,
                      4
                    ]
                  }
                ],
                "orders": [
                  {
                    "column": "user_id",
                    "descending": false
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/absence',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Query: {
                  offset: 0,
                  limit: 0,
                  conditions: [{column: 'user_id', operator: 2, values: [1, 2, 4]}],
                  orders: [{column: 'user_id', descending: false}]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/users/absence';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
            };

            fetch('https://{baseurl}/api/users/absence', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/absence",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Query": {
                "offset": 0,
                "limit": 0,
                "conditions": [
                  {
                    "column": "user_id",
                    "operator": 2,
                    "values": [
                      1,
                      2,
                      4
                    ]
                  }
                ],
                "orders": [
                  {
                    "column": "user_id",
                    "descending": false
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/users/absence");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/users/absence", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/absence"


            payload = {"Query": {
                    "offset": 0,
                    "limit": 0,
                    "conditions": [
                        {
                            "column": "user_id",
                            "operator": 2,
                            "values": [1, 2, 4]
                        }
                    ],
                    "orders": [
                        {
                            "column": "user_id",
                            "descending": False
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/users/absence")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/absence",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/absence');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}');


            $request->setRequestUrl('https://{baseurl}/api/users/absence');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/absence")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/users/absence")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/absence\"\n\n\tpayload := strings.NewReader(\"{\\\"Query\\\":{\\\"offset\\\":0,\\\"limit\\\":0,\\\"conditions\\\":[{\\\"column\\\":\\\"user_id\\\",\\\"operator\\\":2,\\\"values\\\":[1,2,4]}],\\\"orders\\\":[{\\\"column\\\":\\\"user_id\\\",\\\"descending\\\":false}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/absence");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Query": @{ @"offset": @0, @"limit":
            @0, @"conditions": @[ @{ @"column": @"user_id", @"operator": @2,
            @"values": @[ @1, @2, @4 ] } ], @"orders": @[ @{ @"column":
            @"user_id", @"descending": @NO } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/absence"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Query": [
                "offset": 0,
                "limit": 0,
                "conditions": [
                  [
                    "column": "user_id",
                    "operator": 2,
                    "values": [1, 2, 4]
                  ]
                ],
                "orders": [
                  [
                    "column": "user_id",
                    "descending": false
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/absence")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/users/absence");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/users/absence"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/absence' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/absence' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/absence"


            payload <-
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/users/absence" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/absence")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users/absence/delete:
    post:
      tags:
        - User
      summary: Delete Idle Users
      operationId: createUserAbsenceDelete
      description: |-
        This API is used to delete idle users.

        For BODY parameter refer to POST List Idle Users.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAbsenceQueryInput'
      parameters:
        - name: search_month
          in: query
          schema:
            type: integer
          description: Filter user(s) which idle for the last n month(s).
          example: 1
        - name: id
          in: query
          schema:
            type: string
          description: >-
            ID of the idle users which will be deleted. Use space as separator
            to delete multiple users.
          example: 10 11
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
            |  \
              http POST 'https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}' \
              --output-document \
              - 'https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/absence/delete?search_month=1&id=10%2011",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Query: {
                offset: 0,
                limit: 0,
                conditions: [{column: 'user_id', operator: 2, values: [1, 2, 4]}],
                orders: [{column: 'user_id', descending: false}]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/absence/delete',
              qs: {search_month: '1', id: '10 11'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Query: {
                  offset: 0,
                  limit: 0,
                  conditions: [{column: 'user_id', operator: 2, values: [1, 2, 4]}],
                  orders: [{column: 'user_id', descending: false}]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/users/absence/delete");


            req.query({
              "search_month": "1",
              "id": "10 11"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "Query": {
                "offset": 0,
                "limit": 0,
                "conditions": [
                  {
                    "column": "user_id",
                    "operator": 2,
                    "values": [
                      1,
                      2,
                      4
                    ]
                  }
                ],
                "orders": [
                  {
                    "column": "user_id",
                    "descending": false
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/absence/delete',
              params: {search_month: '1', id: '10 11'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Query: {
                  offset: 0,
                  limit: 0,
                  conditions: [{column: 'user_id', operator: 2, values: [1, 2, 4]}],
                  orders: [{column: 'user_id', descending: false}]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
            };


            fetch('https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "Query": {
                "offset": 0,
                "limit": 0,
                "conditions": [
                  {
                    "column": "user_id",
                    "operator": 2,
                    "values": [
                      1,
                      2,
                      4
                    ]
                  }
                ],
                "orders": [
                  {
                    "column": "user_id",
                    "descending": false
                  }
                ]
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/users/absence/delete?search_month=1&id=10%2011",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/absence/delete"


            querystring = {"search_month":"1","id":"10 11"}


            payload = {"Query": {
                    "offset": 0,
                    "limit": 0,
                    "conditions": [
                        {
                            "column": "user_id",
                            "operator": 2,
                            "values": [1, 2, 4]
                        }
                    ],
                    "orders": [
                        {
                            "column": "user_id",
                            "descending": False
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/absence/delete');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'search_month' => '1',
              'id' => '10 11'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}');


            $request->setRequestUrl('https://{baseurl}/api/users/absence/delete');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'search_month' => '1',
              'id' => '10 11'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011\"\n\n\tpayload := strings.NewReader(\"{\\\"Query\\\":{\\\"offset\\\":0,\\\"limit\\\":0,\\\"conditions\\\":[{\\\"column\\\":\\\"user_id\\\",\\\"operator\\\":2,\\\"values\\\":[1,2,4]}],\\\"orders\\\":[{\\\"column\\\":\\\"user_id\\\",\\\"descending\\\":false}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Query": @{ @"offset": @0, @"limit":
            @0, @"conditions": @[ @{ @"column": @"user_id", @"operator": @2,
            @"values": @[ @1, @2, @4 ] } ], @"orders": @[ @{ @"column":
            @"user_id", @"descending": @NO } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Query": [
                "offset": 0,
                "limit": 0,
                "conditions": [
                  [
                    "column": "user_id",
                    "operator": 2,
                    "values": [1, 2, 4]
                  ]
                ],
                "orders": [
                  [
                    "column": "user_id",
                    "descending": false
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Query":{"offset":0,"limit":0,"conditions":[{"column":"user_id","operator":2,"values":[1,2,4]}],"orders":[{"column":"user_id","descending":false}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/absence/delete"


            queryString <- list(
              search_month = "1"
              id = "10 11",
            )


            payload <-
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Query\":{\"offset\":0,\"limit\":0,\"conditions\":[{\"column\":\"user_id\",\"operator\":2,\"values\":[1,2,4]}],\"orders\":[{\"column\":\"user_id\",\"descending\":false}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/absence/delete?search_month=1&id=10%2011")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/users/advance_search:
    post:
      tags:
        - User
      summary: Advanced Search
      operationId: searchUserAdvanceSearch
      description: >-
        This API is used to fetch user information via advanced search.


        Supports flexible searching across multiple user fields including
        personal information, group membership, access levels, and custom
        fields.

        **Notes:**

        - To search users without documents, use `"user_custom_field_#": "No"`
        for specific custom fields

        - To search users with documents, use `"user_custom_field_#": "Yes"` for
        specific custom fields  

        - `user_operator_level_id` values: `-1` (None), `0` (All), or specific
        ID

        - Supports both encrypted and unencrypted field searches

        - Access group search format: "1,2,3" or "*" (any Access Group) or
        "void" (no Access Group)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdvancedSearchCriteria'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  UserCollection:
                    type: object
                    properties:
                      total:
                        type: integer
                        description: Total number of users found
                        example: 1
                      rows:
                        type: array
                        description: Array of user data
                        items:
                          $ref: '#/components/schemas/AdvanceSearchUser'
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/users/advance_search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}'
            |  \
              http POST https://{baseurl}/api/v2/users/advance_search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}' \
              --output-document \
              - https://{baseurl}/api/v2/users/advance_search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/users/advance_search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              limit: 50,
              offset: 0,
              user_id: '11',
              order_by: 'user_id:false',
              user_group_id: 1,
              user_group_ids: [1121],
              user_name: 'John',
              user_email: 'abc@gmail.com',
              user_phone: '123-456-7890',
              user_access_group_ids: '17,18',
              user_operator_level_id: 0,
              user_department: 'Engineering',
              user_title: 'Manager',
              user_card: '123456',
              user_custom_field_1: 'string',
              user_custom_field_2: 'string',
              user_custom_field_3: 'string',
              user_custom_field_4: 'string',
              user_custom_field_5: 'string',
              user_custom_field_6: 'string',
              user_custom_field_7: 'string',
              user_custom_field_8: 'string',
              user_custom_field_9: 'string',
              user_custom_field_10: 'string',
              user_status: false
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/users/advance_search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                limit: 50,
                offset: 0,
                user_id: '11',
                order_by: 'user_id:false',
                user_group_id: 1,
                user_group_ids: [1121],
                user_name: 'John',
                user_email: 'abc@gmail.com',
                user_phone: '123-456-7890',
                user_access_group_ids: '17,18',
                user_operator_level_id: 0,
                user_department: 'Engineering',
                user_title: 'Manager',
                user_card: '123456',
                user_custom_field_1: 'string',
                user_custom_field_2: 'string',
                user_custom_field_3: 'string',
                user_custom_field_4: 'string',
                user_custom_field_5: 'string',
                user_custom_field_6: 'string',
                user_custom_field_7: 'string',
                user_custom_field_8: 'string',
                user_custom_field_9: 'string',
                user_custom_field_10: 'string',
                user_status: false
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/users/advance_search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "limit": 50,
              "offset": 0,
              "user_id": "11",
              "order_by": "user_id:false",
              "user_group_id": 1,
              "user_group_ids": [
                1121
              ],
              "user_name": "John",
              "user_email": "abc@gmail.com",
              "user_phone": "123-456-7890",
              "user_access_group_ids": "17,18",
              "user_operator_level_id": 0,
              "user_department": "Engineering",
              "user_title": "Manager",
              "user_card": "123456",
              "user_custom_field_1": "string",
              "user_custom_field_2": "string",
              "user_custom_field_3": "string",
              "user_custom_field_4": "string",
              "user_custom_field_5": "string",
              "user_custom_field_6": "string",
              "user_custom_field_7": "string",
              "user_custom_field_8": "string",
              "user_custom_field_9": "string",
              "user_custom_field_10": "string",
              "user_status": false
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/users/advance_search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                limit: 50,
                offset: 0,
                user_id: '11',
                order_by: 'user_id:false',
                user_group_id: 1,
                user_group_ids: [1121],
                user_name: 'John',
                user_email: 'abc@gmail.com',
                user_phone: '123-456-7890',
                user_access_group_ids: '17,18',
                user_operator_level_id: 0,
                user_department: 'Engineering',
                user_title: 'Manager',
                user_card: '123456',
                user_custom_field_1: 'string',
                user_custom_field_2: 'string',
                user_custom_field_3: 'string',
                user_custom_field_4: 'string',
                user_custom_field_5: 'string',
                user_custom_field_6: 'string',
                user_custom_field_7: 'string',
                user_custom_field_8: 'string',
                user_custom_field_9: 'string',
                user_custom_field_10: 'string',
                user_status: false
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/users/advance_search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}'
            };

            fetch('https://{baseurl}/api/v2/users/advance_search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/users/advance_search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "limit": 50,
              "offset": 0,
              "user_id": "11",
              "order_by": "user_id:false",
              "user_group_id": 1,
              "user_group_ids": [
                1121
              ],
              "user_name": "John",
              "user_email": "abc@gmail.com",
              "user_phone": "123-456-7890",
              "user_access_group_ids": "17,18",
              "user_operator_level_id": 0,
              "user_department": "Engineering",
              "user_title": "Manager",
              "user_card": "123456",
              "user_custom_field_1": "string",
              "user_custom_field_2": "string",
              "user_custom_field_3": "string",
              "user_custom_field_4": "string",
              "user_custom_field_5": "string",
              "user_custom_field_6": "string",
              "user_custom_field_7": "string",
              "user_custom_field_8": "string",
              "user_custom_field_9": "string",
              "user_custom_field_10": "string",
              "user_status": false
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/users/advance_search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/users/advance_search",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/users/advance_search"


            payload = {
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [1121],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": False
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/users/advance_search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/users/advance_search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/users/advance_search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}');


            $request->setRequestUrl('https://{baseurl}/api/v2/users/advance_search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/users/advance_search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/users/advance_search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/users/advance_search\"\n\n\tpayload := strings.NewReader(\"{\\\"limit\\\":50,\\\"offset\\\":0,\\\"user_id\\\":\\\"11\\\",\\\"order_by\\\":\\\"user_id:false\\\",\\\"user_group_id\\\":1,\\\"user_group_ids\\\":[1121],\\\"user_name\\\":\\\"John\\\",\\\"user_email\\\":\\\"abc@gmail.com\\\",\\\"user_phone\\\":\\\"123-456-7890\\\",\\\"user_access_group_ids\\\":\\\"17,18\\\",\\\"user_operator_level_id\\\":0,\\\"user_department\\\":\\\"Engineering\\\",\\\"user_title\\\":\\\"Manager\\\",\\\"user_card\\\":\\\"123456\\\",\\\"user_custom_field_1\\\":\\\"string\\\",\\\"user_custom_field_2\\\":\\\"string\\\",\\\"user_custom_field_3\\\":\\\"string\\\",\\\"user_custom_field_4\\\":\\\"string\\\",\\\"user_custom_field_5\\\":\\\"string\\\",\\\"user_custom_field_6\\\":\\\"string\\\",\\\"user_custom_field_7\\\":\\\"string\\\",\\\"user_custom_field_8\\\":\\\"string\\\",\\\"user_custom_field_9\\\":\\\"string\\\",\\\"user_custom_field_10\\\":\\\"string\\\",\\\"user_status\\\":false}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/users/advance_search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"limit": @50,
                                          @"offset": @0,
                                          @"user_id": @"11",
                                          @"order_by": @"user_id:false",
                                          @"user_group_id": @1,
                                          @"user_group_ids": @[ @1121 ],
                                          @"user_name": @"John",
                                          @"user_email": @"abc@gmail.com",
                                          @"user_phone": @"123-456-7890",
                                          @"user_access_group_ids": @"17,18",
                                          @"user_operator_level_id": @0,
                                          @"user_department": @"Engineering",
                                          @"user_title": @"Manager",
                                          @"user_card": @"123456",
                                          @"user_custom_field_1": @"string",
                                          @"user_custom_field_2": @"string",
                                          @"user_custom_field_3": @"string",
                                          @"user_custom_field_4": @"string",
                                          @"user_custom_field_5": @"string",
                                          @"user_custom_field_6": @"string",
                                          @"user_custom_field_7": @"string",
                                          @"user_custom_field_8": @"string",
                                          @"user_custom_field_9": @"string",
                                          @"user_custom_field_10": @"string",
                                          @"user_status": @NO };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/users/advance_search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "limit": 50,
              "offset": 0,
              "user_id": "11",
              "order_by": "user_id:false",
              "user_group_id": 1,
              "user_group_ids": [1121],
              "user_name": "John",
              "user_email": "abc@gmail.com",
              "user_phone": "123-456-7890",
              "user_access_group_ids": "17,18",
              "user_operator_level_id": 0,
              "user_department": "Engineering",
              "user_title": "Manager",
              "user_card": "123456",
              "user_custom_field_1": "string",
              "user_custom_field_2": "string",
              "user_custom_field_3": "string",
              "user_custom_field_4": "string",
              "user_custom_field_5": "string",
              "user_custom_field_6": "string",
              "user_custom_field_7": "string",
              "user_custom_field_8": "string",
              "user_custom_field_9": "string",
              "user_custom_field_10": "string",
              "user_status": false
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/users/advance_search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/users/advance_search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/users/advance_search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/users/advance_search' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/users/advance_search' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/users/advance_search"


            payload <-
            "{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/users/advance_search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/users/advance_search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/users/search:
    post:
      tags:
        - User
      summary: List All User v2
      operationId: searchUserSearch
      description: |-
        This API is used to list all users recorded on Bio Star X.

        **Known errors:**
        - At least one parameter must exist
            
        - Using unavailable `user_group_id` will show empty response
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserSearchInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/users/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"limit":50,"search_text":"John","user_group_id":1,"order_by":"user_id:false"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"limit":50,"search_text":"John","user_group_id":1,"order_by":"user_id:false"}'
            |  \
              http POST https://{baseurl}/api/v2/users/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"limit":50,"search_text":"John","user_group_id":1,"order_by":"user_id:false"}' \
              --output-document \
              - https://{baseurl}/api/v2/users/search
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/users/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({limit: 50, search_text: 'John',
            user_group_id: 1, order_by: 'user_id:false'}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/users/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {limit: 50, search_text: 'John', user_group_id: 1, order_by: 'user_id:false'},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/users/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "limit": 50,
              "search_text": "John",
              "user_group_id": 1,
              "order_by": "user_id:false"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/users/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {limit: 50, search_text: 'John', user_group_id: 1, order_by: 'user_id:false'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/users/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":50,"search_text":"John","user_group_id":1,"order_by":"user_id:false"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":50,"search_text":"John","user_group_id":1,"order_by":"user_id:false"}'
            };

            fetch('https://{baseurl}/api/v2/users/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/users/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "limit": 50,
              "search_text": "John",
              "user_group_id": 1,
              "order_by": "user_id:false"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/users/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/users/search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/users/search"


            payload = {
                "limit": 50,
                "search_text": "John",
                "user_group_id": 1,
                "order_by": "user_id:false"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/users/search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/users/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/users/search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"limit":50,"search_text":"John","user_group_id":1,"order_by":"user_id:false"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"limit":50,"search_text":"John","user_group_id":1,"order_by":"user_id:false"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/users/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/users/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/users/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/users/search\"\n\n\tpayload := strings.NewReader(\"{\\\"limit\\\":50,\\\"search_text\\\":\\\"John\\\",\\\"user_group_id\\\":1,\\\"order_by\\\":\\\"user_id:false\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/users/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"limit": @50,
                                          @"search_text": @"John",
                                          @"user_group_id": @1,
                                          @"order_by": @"user_id:false" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/users/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "limit": 50,
              "search_text": "John",
              "user_group_id": 1,
              "order_by": "user_id:false"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/users/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/users/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/users/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/users/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"limit":50,"search_text":"John","user_group_id":1,"order_by":"user_id:false"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/users/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"limit":50,"search_text":"John","user_group_id":1,"order_by":"user_id:false"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/users/search"


            payload <-
            "{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/users/search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"limit\":50,\"search_text\":\"John\",\"user_group_id\":1,\"order_by\":\"user_id:false\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/users/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/permissions:
    get:
      tags:
        - User
      summary: View User by Account Level
      operationId: listPermissions
      description: >-
        This API is used to view all user permission grouped by user account
        level.


        1: Administrator  

        2: User Operator  

        3: Monitoring Operator  

        4-252: Custom Account Level  

        253: Video  

        254: TA  

        255: User  

        100000: Visitor
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/permissions \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/permissions \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/permissions
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/permissions",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/permissions',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/permissions");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/permissions',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/permissions';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/permissions', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/permissions",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/permissions");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/permissions", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/permissions"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/permissions")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/permissions",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/permissions');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/permissions');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/permissions")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/permissions")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/permissions\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/permissions");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/permissions"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/permissions")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/permissions");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/permissions"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/permissions' -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/permissions' -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/permissions"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/permissions" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/permissions")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/users/csv_option:
    get:
      tags:
        - User
      summary: List User Fields
      operationId: getUserCsvOption
      description: This API is used to list user fields which can be processed as CSV.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/users/csv_option \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/users/csv_option \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/users/csv_option
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/csv_option",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/users/csv_option',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/users/csv_option");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/users/csv_option',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/users/csv_option';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/users/csv_option', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/csv_option",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/users/csv_option");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/users/csv_option",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/users/csv_option"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/users/csv_option")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/csv_option",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/users/csv_option');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/users/csv_option');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/csv_option")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/users/csv_option")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/csv_option\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/csv_option");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/csv_option"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/csv_option")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/csv_option");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/users/csv_option"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/csv_option' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/csv_option' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/csv_option"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/users/csv_option" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/csv_option")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /download/{csv_filename}:
    get:
      tags:
        - User
        - Events
      summary: Download CSV File
      operationId: downloadCsvFilename
      description: >-
        This API is used to download exported CSV files from BioStar X Server.


        Supports downloading both user-related CSV files and events-related CSV
        files. The system automatically detects the file type based on the
        filename pattern.


        **Supported File Types:**

        - **User CSV files**: Generated from `POST /api/users/csv_export`

        - **Events CSV files**: Generated from `POST /api/events/export`


        **Usage:**

        1. Export data using the appropriate API (`csv_export` for users,
        `export` for events)

        2. Get the filename from the export response

        3. Use the filename as the path parameter in this download API
      parameters:
        - name: csv_filename
          in: path
          schema:
            type: string
          required: true
          description: >-
            Name of the CSV file to download (supports both user and events
            files)
          examples:
            user_file:
              summary: User CSV file
              value: User_Import_Error_20220124T143708.csv
            events_file:
              summary: Events CSV file
              value: Report_20220204T165145.csv
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/download/User_Import_Error_20220124T143708.csv \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            https://{baseurl}/download/User_Import_Error_20220124T143708.csv \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/download/User_Import_Error_20220124T143708.csv
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/download/User_Import_Error_20220124T143708.csv",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/download/User_Import_Error_20220124T143708.csv',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/download/User_Import_Error_20220124T143708.csv");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/download/User_Import_Error_20220124T143708.csv',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/download/User_Import_Error_20220124T143708.csv';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/download/User_Import_Error_20220124T143708.csv',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/download/User_Import_Error_20220124T143708.csv",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/download/User_Import_Error_20220124T143708.csv");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/download/User_Import_Error_20220124T143708.csv",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url =
            "https://{baseurl}/download/User_Import_Error_20220124T143708.csv"


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/download/User_Import_Error_20220124T143708.csv")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/download/User_Import_Error_20220124T143708.csv",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/download/User_Import_Error_20220124T143708.csv');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/download/User_Import_Error_20220124T143708.csv');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/download/User_Import_Error_20220124T143708.csv")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/download/User_Import_Error_20220124T143708.csv")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/download/User_Import_Error_20220124T143708.csv\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/download/User_Import_Error_20220124T143708.csv");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/download/User_Import_Error_20220124T143708.csv"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/download/User_Import_Error_20220124T143708.csv")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/download/User_Import_Error_20220124T143708.csv");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/download/User_Import_Error_20220124T143708.csv"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/download/User_Import_Error_20220124T143708.csv'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/download/User_Import_Error_20220124T143708.csv'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <-
            "https://{baseurl}/download/User_Import_Error_20220124T143708.csv"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/download/User_Import_Error_20220124T143708.csv"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/download/User_Import_Error_20220124T143708.csv")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/attachments:
    post:
      tags:
        - User
      summary: Upload User File (CSV/TGZ) to BioStar X Server
      operationId: createAttachments
      description: >-
        This API is used to upload a file to BioStar X Server.


        Usage of this API is to upload a .csv or .tgz file to BioStar X Server
        Installation path, which after the file can be further processed for
        importing User Data to the database through `POST /api/users/csv_import`
        or `POST /api/users/data_import`.


        Uploaded file will be located on: {{BioStar X Installation
        Path}}\\nginx\\html\\download


        Do note that if there's any file with the same name, it will be
        overwritten
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  example: /C:/Users/user/Desktop/BioStarX_20220124_173247.tgz
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/attachments \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: multipart/form-data' \
              --form file=/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz
        - lang: shell_httpie
          label: Shell + Httpie
          source: "echo '-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n' |  \\\n  http POST https://{baseurl}/api/attachments \\\n  bs-session-id:REPLACE_KEY_VALUE \\\n  content-type:multipart/form-data"
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: multipart/form-data' \
              --body-data '-----011000010111000001101001\r\nContent-Disposition: form-data; name="file"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n' \
              --output-document \
              - https://{baseurl}/api/attachments
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/attachments",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "multipart/form-data"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write("-----011000010111000001101001\r\nContent-Disposition:
            form-data;
            name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n");

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/attachments',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'multipart/form-data'},
              formData: {file: '/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/attachments");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "multipart/form-data"
            });

            req.multipart([
              {
                "body": "/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz"
              }
            ]);

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/attachments',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'multipart/form-data'},
              data: '-----011000010111000001101001\r\nContent-Disposition: form-data; name="file"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n'
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const FormData = require('form-data');

            const fetch = require('node-fetch');

            const formData = new FormData();


            formData.append('file',
            '/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz');


            let url = 'https://{baseurl}/api/attachments';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'multipart/form-data'}
            };


            options.body = formData;


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const form = new FormData();

            form.append("file",
            "/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz");


            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'multipart/form-data'}
            };


            options.body = form;


            fetch('https://{baseurl}/api/attachments', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: >-
            const form = new FormData();

            form.append("file",
            "/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz");


            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/attachments",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              },
              "processData": false,
              "contentType": false,
              "mimeType": "multipart/form-data",
              "data": form
            };


            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = new FormData();

            data.append("file",
            "/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz");


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST", "https://{baseurl}/api/attachments");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "-----011000010111000001101001\r\nContent-Disposition:
            form-data;
            name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n"


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("POST", "{baseurl}/api/attachments", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/attachments"


            payload = "-----011000010111000001101001\r\nContent-Disposition:
            form-data;
            name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("POST", url, data=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/attachments")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request.body =
            "-----011000010111000001101001\r\nContent-Disposition: form-data;
            name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/attachments",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: multipart/form-data"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: "<?php\n\n$request = new HttpRequest();\n$request->setUrl('https://{baseurl}/api/attachments');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders([\n  'bs-session-id' => 'REPLACE_KEY_VALUE',\n  'content-type' => 'multipart/form-data'\n]);\n\n$request->setBody('-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n');\n\ntry {\n  $response = $request->send();\n\n  echo $response->getBody();\n} catch (HttpException $ex) {\n  echo $ex;\n}"
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->addForm([
              'file' => '/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz'
            ], null);

            $request->setRequestUrl('https://{baseurl}/api/attachments');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("multipart/form-data;
            boundary=---011000010111000001101001");

            RequestBody body = RequestBody.create(mediaType,
            "-----011000010111000001101001\r\nContent-Disposition: form-data;
            name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/attachments")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/attachments")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/attachments\"\n\n\tpayload := strings.NewReader(\"-----011000010111000001101001\\r\\nContent-Disposition: form-data; name=\\\"file\\\"\\r\\n\\r\\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\\r\\n-----011000010111000001101001--\\r\\n\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/attachments");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "-----011000010111000001101001\r\nContent-Disposition: form-data;
            name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };

            NSArray *parameters = @[ @{ @"name": @"file", @"value":
            @"/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz" } ];

            NSString *boundary = @"---011000010111000001101001";


            NSError *error;

            NSMutableString *body = [NSMutableString string];

            for (NSDictionary *param in parameters) {
                [body appendFormat:@"--%@\r\n", boundary];
                if (param[@"fileName"]) {
                    [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"\r\n", param[@"name"], param[@"fileName"]];
                    [body appendFormat:@"Content-Type: %@\r\n\r\n", param[@"contentType"]];
                    [body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];
                    if (error) {
                        NSLog(@"%@", error);
                    }
                } else {
                    [body appendFormat:@"Content-Disposition:form-data; name=\"%@\"\r\n\r\n", param[@"name"]];
                    [body appendFormat:@"%@", param[@"value"]];
                }
            }

            [body appendFormat:@"\r\n--%@--\r\n", boundary];

            NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/attachments"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]

            let parameters = [
              [
                "name": "file",
                "value": "/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz"
              ]
            ]


            let boundary = "---011000010111000001101001"


            var body = ""

            var error: NSError? = nil

            for param in parameters {
              let paramName = param["name"]!
              body += "--\(boundary)\r\n"
              body += "Content-Disposition:form-data; name=\"\(paramName)\""
              if let filename = param["fileName"] {
                let contentType = param["content-type"]!
                let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
                if (error != nil) {
                  print(error)
                }
                body += "; filename=\"\(filename)\"\r\n"
                body += "Content-Type: \(contentType)\r\n\r\n"
                body += fileContent
              } else if let paramValue = param["value"] {
                body += "\r\n\r\n\(paramValue)"
              }
            }


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/attachments")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/attachments");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddParameter("undefined",
            "-----011000010111000001101001\r\nContent-Disposition: form-data;
            name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/attachments"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new MultipartFormDataContent
                {
                    new StringContent("/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz")
                    {
                        Headers =
                        {
                            ContentDisposition = new ContentDispositionHeaderValue("form-data")
                            {
                                Name = "file",
                            }
                        }
                    },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: "$headers=@{}\n$headers.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-WebRequest -Uri 'https://{baseurl}/api/attachments' -Method POST -Headers $headers -ContentType 'undefined' -Body '-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n'"
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: "$headers=@{}\n$headers.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://{baseurl}/api/attachments' -Method POST -Headers $headers -ContentType 'undefined' -Body '-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n'"
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/attachments"


            payload <- "-----011000010111000001101001\r\nContent-Disposition:
            form-data;
            name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n"


            encode <- "multipart"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE'),
            content_type("multipart/form-data"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/attachments" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in

            let body = Cohttp_lwt_body.of_string
            "-----011000010111000001101001\r\nContent-Disposition: form-data;
            name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("multipart/form-data;
            boundary=---011000010111000001101001")

            val body = RequestBody.create(mediaType,
            "-----011000010111000001101001\r\nContent-Disposition: form-data;
            name=\"file\"\r\n\r\n/C:/Users/user/Desktop/BioStarX_20220124_173247.tgz\r\n-----011000010111000001101001--\r\n")

            val request = Request.Builder()
              .url("https://{baseurl}/api/attachments")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/users/csv_export:
    post:
      tags:
        - User
      summary: Export User Data as CSV (File Upload Example)
      operationId: exportUserCsvExport
      description: >-
        This API is used to export user data as CSV file with customizable
        columns and headers.

        Supports exporting user information including custom fields and file
        upload information. The exported CSV file can be downloaded using the
        `/download/{csv_filename}` endpoint.


        **Features:**

        - Customizable column selection and headers

        - Support for custom fields including file upload fields

        - Advanced search criteria integration

        - Flexible user selection (specific IDs, all users, or search results)


        **Usage Flow:**

        1. Call this API with desired query parameters and criteria

        2. Get the generated filename from the response

        3. Use the filename with `/download/{csv_filename}` to download the
        actual CSV file
      parameters:
        - name: id
          in: query
          schema:
            type: string
          description: >-
            ID of the Users to export. Use `*` to export all users.  To select
            multiple users use plus sign (+) or space ( ) as separator.
          examples:
            all_users:
              summary: Export all users
              value: '*'
            specific_users:
              summary: Export specific users
              value: 1+2+3
            single_user:
              summary: Export single user
              value: '1001'
        - name: adv
          in: query
          schema:
            type: string
            enum:
              - mode1
          description: Enable Advanced Search query result mode
          example: mode1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCsvExportInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  File:
                    type: object
                    properties:
                      uri:
                        type: string
                        description: >-
                          Exported CSV filename that can be used with download
                          API
                        example: User_20241030_7f554f6983034c8eb1b42076f68e488b.csv
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/users/csv_export?id=*&adv=mode1' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Query":{"offset":0,"group_by":1,"columns":["user_id","name","email","user_group_id","access_groups","start_datetime","expiry_datetime","operator_level","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"],"headers":["ID","Name","Email","Group","Access Group","Start datetime","End datetime","Operator Level","Fingerprint","Face","Visual Face","Card","PIN","QR/Barcode","Mobile Access Card","Status"]},"adv_criteria":{"limit":1000,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For backup"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Query":{"offset":0,"group_by":1,"columns":["user_id","name","email","user_group_id","access_groups","start_datetime","expiry_datetime","operator_level","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"],"headers":["ID","Name","Email","Group","Access
            Group","Start datetime","End datetime","Operator
            Level","Fingerprint","Face","Visual
            Face","Card","PIN","QR/Barcode","Mobile Access
            Card","Status"]},"adv_criteria":{"limit":1000,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For
            backup"}' |  \
              http POST 'https://{baseurl}/api/users/csv_export?id=*&adv=mode1' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Query":{"offset":0,"group_by":1,"columns":["user_id","name","email","user_group_id","access_groups","start_datetime","expiry_datetime","operator_level","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"],"headers":["ID","Name","Email","Group","Access Group","Start datetime","End datetime","Operator Level","Fingerprint","Face","Visual Face","Card","PIN","QR/Barcode","Mobile Access Card","Status"]},"adv_criteria":{"limit":1000,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For backup"}' \
              --output-document \
              - 'https://{baseurl}/api/users/csv_export?id=*&adv=mode1'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/csv_export?id=*&adv=mode1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Query: {
                offset: 0,
                group_by: 1,
                columns: [
                  'user_id',
                  'name',
                  'email',
                  'user_group_id',
                  'access_groups',
                  'start_datetime',
                  'expiry_datetime',
                  'operator_level',
                  'fingerprint_template_count',
                  'face_count',
                  'visual_face_count',
                  'card_count',
                  'have_pin',
                  'qr_count',
                  'mobile_count',
                  'disabled'
                ],
                headers: [
                  'ID',
                  'Name',
                  'Email',
                  'Group',
                  'Access Group',
                  'Start datetime',
                  'End datetime',
                  'Operator Level',
                  'Fingerprint',
                  'Face',
                  'Visual Face',
                  'Card',
                  'PIN',
                  'QR/Barcode',
                  'Mobile Access Card',
                  'Status'
                ]
              },
              adv_criteria: {
                limit: 1000,
                offset: 0,
                user_id: '11',
                order_by: 'user_id:false',
                user_group_id: 1,
                user_group_ids: [1121],
                user_name: 'John',
                user_email: 'abc@gmail.com',
                user_phone: '123-456-7890',
                user_access_group_ids: '17,18',
                user_operator_level_id: 0,
                user_department: 'Engineering',
                user_title: 'Manager',
                user_card: '123456',
                user_custom_field_1: 'string',
                user_custom_field_2: 'string',
                user_custom_field_3: 'string',
                user_custom_field_4: 'string',
                user_custom_field_5: 'string',
                user_custom_field_6: 'string',
                user_custom_field_7: 'string',
                user_custom_field_8: 'string',
                user_custom_field_9: 'string',
                user_custom_field_10: 'string',
                user_status: false
              },
              reason: 'For backup'
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/csv_export',
              qs: {id: '*', adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Query: {
                  offset: 0,
                  group_by: 1,
                  columns: [
                    'user_id',
                    'name',
                    'email',
                    'user_group_id',
                    'access_groups',
                    'start_datetime',
                    'expiry_datetime',
                    'operator_level',
                    'fingerprint_template_count',
                    'face_count',
                    'visual_face_count',
                    'card_count',
                    'have_pin',
                    'qr_count',
                    'mobile_count',
                    'disabled'
                  ],
                  headers: [
                    'ID',
                    'Name',
                    'Email',
                    'Group',
                    'Access Group',
                    'Start datetime',
                    'End datetime',
                    'Operator Level',
                    'Fingerprint',
                    'Face',
                    'Visual Face',
                    'Card',
                    'PIN',
                    'QR/Barcode',
                    'Mobile Access Card',
                    'Status'
                  ]
                },
                adv_criteria: {
                  limit: 1000,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                },
                reason: 'For backup'
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/users/csv_export");


            req.query({
              "id": "*",
              "adv": "mode1"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "Query": {
                "offset": 0,
                "group_by": 1,
                "columns": [
                  "user_id",
                  "name",
                  "email",
                  "user_group_id",
                  "access_groups",
                  "start_datetime",
                  "expiry_datetime",
                  "operator_level",
                  "fingerprint_template_count",
                  "face_count",
                  "visual_face_count",
                  "card_count",
                  "have_pin",
                  "qr_count",
                  "mobile_count",
                  "disabled"
                ],
                "headers": [
                  "ID",
                  "Name",
                  "Email",
                  "Group",
                  "Access Group",
                  "Start datetime",
                  "End datetime",
                  "Operator Level",
                  "Fingerprint",
                  "Face",
                  "Visual Face",
                  "Card",
                  "PIN",
                  "QR/Barcode",
                  "Mobile Access Card",
                  "Status"
                ]
              },
              "adv_criteria": {
                "limit": 1000,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              },
              "reason": "For backup"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/csv_export',
              params: {id: '*', adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Query: {
                  offset: 0,
                  group_by: 1,
                  columns: [
                    'user_id',
                    'name',
                    'email',
                    'user_group_id',
                    'access_groups',
                    'start_datetime',
                    'expiry_datetime',
                    'operator_level',
                    'fingerprint_template_count',
                    'face_count',
                    'visual_face_count',
                    'card_count',
                    'have_pin',
                    'qr_count',
                    'mobile_count',
                    'disabled'
                  ],
                  headers: [
                    'ID',
                    'Name',
                    'Email',
                    'Group',
                    'Access Group',
                    'Start datetime',
                    'End datetime',
                    'Operator Level',
                    'Fingerprint',
                    'Face',
                    'Visual Face',
                    'Card',
                    'PIN',
                    'QR/Barcode',
                    'Mobile Access Card',
                    'Status'
                  ]
                },
                adv_criteria: {
                  limit: 1000,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                },
                reason: 'For backup'
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/users/csv_export?id=*&adv=mode1';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"offset":0,"group_by":1,"columns":["user_id","name","email","user_group_id","access_groups","start_datetime","expiry_datetime","operator_level","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"],"headers":["ID","Name","Email","Group","Access Group","Start datetime","End datetime","Operator Level","Fingerprint","Face","Visual Face","Card","PIN","QR/Barcode","Mobile Access Card","Status"]},"adv_criteria":{"limit":1000,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For backup"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"offset":0,"group_by":1,"columns":["user_id","name","email","user_group_id","access_groups","start_datetime","expiry_datetime","operator_level","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"],"headers":["ID","Name","Email","Group","Access Group","Start datetime","End datetime","Operator Level","Fingerprint","Face","Visual Face","Card","PIN","QR/Barcode","Mobile Access Card","Status"]},"adv_criteria":{"limit":1000,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For backup"}'
            };


            fetch('https://{baseurl}/api/users/csv_export?id=*&adv=mode1',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/csv_export?id=*&adv=mode1",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access Group\",\"Start datetime\",\"End datetime\",\"Operator Level\",\"Fingerprint\",\"Face\",\"Visual Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For backup\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "Query": {
                "offset": 0,
                "group_by": 1,
                "columns": [
                  "user_id",
                  "name",
                  "email",
                  "user_group_id",
                  "access_groups",
                  "start_datetime",
                  "expiry_datetime",
                  "operator_level",
                  "fingerprint_template_count",
                  "face_count",
                  "visual_face_count",
                  "card_count",
                  "have_pin",
                  "qr_count",
                  "mobile_count",
                  "disabled"
                ],
                "headers": [
                  "ID",
                  "Name",
                  "Email",
                  "Group",
                  "Access Group",
                  "Start datetime",
                  "End datetime",
                  "Operator Level",
                  "Fingerprint",
                  "Face",
                  "Visual Face",
                  "Card",
                  "PIN",
                  "QR/Barcode",
                  "Mobile Access Card",
                  "Status"
                ]
              },
              "adv_criteria": {
                "limit": 1000,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              },
              "reason": "For backup"
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/users/csv_export?id=*&adv=mode1");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access
            Group\",\"Start datetime\",\"End datetime\",\"Operator
            Level\",\"Fingerprint\",\"Face\",\"Visual
            Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access
            Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            backup\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/users/csv_export?id=*&adv=mode1", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/csv_export"


            querystring = {"id":"*","adv":"mode1"}


            payload = {
                "Query": {
                    "offset": 0,
                    "group_by": 1,
                    "columns": ["user_id", "name", "email", "user_group_id", "access_groups", "start_datetime", "expiry_datetime", "operator_level", "fingerprint_template_count", "face_count", "visual_face_count", "card_count", "have_pin", "qr_count", "mobile_count", "disabled"],
                    "headers": ["ID", "Name", "Email", "Group", "Access Group", "Start datetime", "End datetime", "Operator Level", "Fingerprint", "Face", "Visual Face", "Card", "PIN", "QR/Barcode", "Mobile Access Card", "Status"]
                },
                "adv_criteria": {
                    "limit": 1000,
                    "offset": 0,
                    "user_id": "11",
                    "order_by": "user_id:false",
                    "user_group_id": 1,
                    "user_group_ids": [1121],
                    "user_name": "John",
                    "user_email": "abc@gmail.com",
                    "user_phone": "123-456-7890",
                    "user_access_group_ids": "17,18",
                    "user_operator_level_id": 0,
                    "user_department": "Engineering",
                    "user_title": "Manager",
                    "user_card": "123456",
                    "user_custom_field_1": "string",
                    "user_custom_field_2": "string",
                    "user_custom_field_3": "string",
                    "user_custom_field_4": "string",
                    "user_custom_field_5": "string",
                    "user_custom_field_6": "string",
                    "user_custom_field_7": "string",
                    "user_custom_field_8": "string",
                    "user_custom_field_9": "string",
                    "user_custom_field_10": "string",
                    "user_status": False
                },
                "reason": "For backup"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/users/csv_export?id=*&adv=mode1")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access
            Group\",\"Start datetime\",\"End datetime\",\"Operator
            Level\",\"Fingerprint\",\"Face\",\"Visual
            Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access
            Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            backup\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/csv_export?id=*&adv=mode1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access Group\",\"Start datetime\",\"End datetime\",\"Operator Level\",\"Fingerprint\",\"Face\",\"Visual Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For backup\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/csv_export');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'id' => '*',
              'adv' => 'mode1'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Query":{"offset":0,"group_by":1,"columns":["user_id","name","email","user_group_id","access_groups","start_datetime","expiry_datetime","operator_level","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"],"headers":["ID","Name","Email","Group","Access
            Group","Start datetime","End datetime","Operator
            Level","Fingerprint","Face","Visual
            Face","Card","PIN","QR/Barcode","Mobile Access
            Card","Status"]},"adv_criteria":{"limit":1000,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For
            backup"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Query":{"offset":0,"group_by":1,"columns":["user_id","name","email","user_group_id","access_groups","start_datetime","expiry_datetime","operator_level","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"],"headers":["ID","Name","Email","Group","Access
            Group","Start datetime","End datetime","Operator
            Level","Fingerprint","Face","Visual
            Face","Card","PIN","QR/Barcode","Mobile Access
            Card","Status"]},"adv_criteria":{"limit":1000,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For
            backup"}');


            $request->setRequestUrl('https://{baseurl}/api/users/csv_export');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'id' => '*',
              'adv' => 'mode1'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access
            Group\",\"Start datetime\",\"End datetime\",\"Operator
            Level\",\"Fingerprint\",\"Face\",\"Visual
            Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access
            Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            backup\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/csv_export?id=*&adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/users/csv_export?id=*&adv=mode1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access Group\",\"Start datetime\",\"End datetime\",\"Operator Level\",\"Fingerprint\",\"Face\",\"Visual Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For backup\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/csv_export?id=*&adv=mode1\"\n\n\tpayload := strings.NewReader(\"{\\\"Query\\\":{\\\"offset\\\":0,\\\"group_by\\\":1,\\\"columns\\\":[\\\"user_id\\\",\\\"name\\\",\\\"email\\\",\\\"user_group_id\\\",\\\"access_groups\\\",\\\"start_datetime\\\",\\\"expiry_datetime\\\",\\\"operator_level\\\",\\\"fingerprint_template_count\\\",\\\"face_count\\\",\\\"visual_face_count\\\",\\\"card_count\\\",\\\"have_pin\\\",\\\"qr_count\\\",\\\"mobile_count\\\",\\\"disabled\\\"],\\\"headers\\\":[\\\"ID\\\",\\\"Name\\\",\\\"Email\\\",\\\"Group\\\",\\\"Access Group\\\",\\\"Start datetime\\\",\\\"End datetime\\\",\\\"Operator Level\\\",\\\"Fingerprint\\\",\\\"Face\\\",\\\"Visual Face\\\",\\\"Card\\\",\\\"PIN\\\",\\\"QR/Barcode\\\",\\\"Mobile Access Card\\\",\\\"Status\\\"]},\\\"adv_criteria\\\":{\\\"limit\\\":1000,\\\"offset\\\":0,\\\"user_id\\\":\\\"11\\\",\\\"order_by\\\":\\\"user_id:false\\\",\\\"user_group_id\\\":1,\\\"user_group_ids\\\":[1121],\\\"user_name\\\":\\\"John\\\",\\\"user_email\\\":\\\"abc@gmail.com\\\",\\\"user_phone\\\":\\\"123-456-7890\\\",\\\"user_access_group_ids\\\":\\\"17,18\\\",\\\"user_operator_level_id\\\":0,\\\"user_department\\\":\\\"Engineering\\\",\\\"user_title\\\":\\\"Manager\\\",\\\"user_card\\\":\\\"123456\\\",\\\"user_custom_field_1\\\":\\\"string\\\",\\\"user_custom_field_2\\\":\\\"string\\\",\\\"user_custom_field_3\\\":\\\"string\\\",\\\"user_custom_field_4\\\":\\\"string\\\",\\\"user_custom_field_5\\\":\\\"string\\\",\\\"user_custom_field_6\\\":\\\"string\\\",\\\"user_custom_field_7\\\":\\\"string\\\",\\\"user_custom_field_8\\\":\\\"string\\\",\\\"user_custom_field_9\\\":\\\"string\\\",\\\"user_custom_field_10\\\":\\\"string\\\",\\\"user_status\\\":false},\\\"reason\\\":\\\"For backup\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/csv_export?id=*&adv=mode1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access
            Group\",\"Start datetime\",\"End datetime\",\"Operator
            Level\",\"Fingerprint\",\"Face\",\"Visual
            Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access
            Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            backup\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Query": @{ @"offset": @0,
            @"group_by": @1, @"columns": @[ @"user_id", @"name", @"email",
            @"user_group_id", @"access_groups", @"start_datetime",
            @"expiry_datetime", @"operator_level",
            @"fingerprint_template_count", @"face_count", @"visual_face_count",
            @"card_count", @"have_pin", @"qr_count", @"mobile_count",
            @"disabled" ], @"headers": @[ @"ID", @"Name", @"Email", @"Group",
            @"Access Group", @"Start datetime", @"End datetime", @"Operator
            Level", @"Fingerprint", @"Face", @"Visual Face", @"Card", @"PIN",
            @"QR/Barcode", @"Mobile Access Card", @"Status" ] },
                                          @"adv_criteria": @{ @"limit": @1000, @"offset": @0, @"user_id": @"11", @"order_by": @"user_id:false", @"user_group_id": @1, @"user_group_ids": @[ @1121 ], @"user_name": @"John", @"user_email": @"abc@gmail.com", @"user_phone": @"123-456-7890", @"user_access_group_ids": @"17,18", @"user_operator_level_id": @0, @"user_department": @"Engineering", @"user_title": @"Manager", @"user_card": @"123456", @"user_custom_field_1": @"string", @"user_custom_field_2": @"string", @"user_custom_field_3": @"string", @"user_custom_field_4": @"string", @"user_custom_field_5": @"string", @"user_custom_field_6": @"string", @"user_custom_field_7": @"string", @"user_custom_field_8": @"string", @"user_custom_field_9": @"string", @"user_custom_field_10": @"string", @"user_status": @NO },
                                          @"reason": @"For backup" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/csv_export?id=*&adv=mode1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "Query": [
                "offset": 0,
                "group_by": 1,
                "columns": ["user_id", "name", "email", "user_group_id", "access_groups", "start_datetime", "expiry_datetime", "operator_level", "fingerprint_template_count", "face_count", "visual_face_count", "card_count", "have_pin", "qr_count", "mobile_count", "disabled"],
                "headers": ["ID", "Name", "Email", "Group", "Access Group", "Start datetime", "End datetime", "Operator Level", "Fingerprint", "Face", "Visual Face", "Card", "PIN", "QR/Barcode", "Mobile Access Card", "Status"]
              ],
              "adv_criteria": [
                "limit": 1000,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [1121],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              ],
              "reason": "For backup"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/csv_export?id=*&adv=mode1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/csv_export?id=*&adv=mode1");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access
            Group\",\"Start datetime\",\"End datetime\",\"Operator
            Level\",\"Fingerprint\",\"Face\",\"Visual
            Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access
            Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            backup\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/users/csv_export?id=*&adv=mode1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access Group\",\"Start datetime\",\"End datetime\",\"Operator Level\",\"Fingerprint\",\"Face\",\"Visual Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For backup\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/csv_export?id=*&adv=mode1' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"Query":{"offset":0,"group_by":1,"columns":["user_id","name","email","user_group_id","access_groups","start_datetime","expiry_datetime","operator_level","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"],"headers":["ID","Name","Email","Group","Access
            Group","Start datetime","End datetime","Operator
            Level","Fingerprint","Face","Visual
            Face","Card","PIN","QR/Barcode","Mobile Access
            Card","Status"]},"adv_criteria":{"limit":1000,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For
            backup"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/csv_export?id=*&adv=mode1' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"Query":{"offset":0,"group_by":1,"columns":["user_id","name","email","user_group_id","access_groups","start_datetime","expiry_datetime","operator_level","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"],"headers":["ID","Name","Email","Group","Access
            Group","Start datetime","End datetime","Operator
            Level","Fingerprint","Face","Visual
            Face","Card","PIN","QR/Barcode","Mobile Access
            Card","Status"]},"adv_criteria":{"limit":1000,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For
            backup"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/csv_export"


            queryString <- list(
              id = "*"
              adv = "mode1",
            )


            payload <-
            "{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access
            Group\",\"Start datetime\",\"End datetime\",\"Operator
            Level\",\"Fingerprint\",\"Face\",\"Visual
            Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access
            Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            backup\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/users/csv_export?id=*&adv=mode1" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access
            Group\",\"Start datetime\",\"End datetime\",\"Operator
            Level\",\"Fingerprint\",\"Face\",\"Visual
            Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access
            Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            backup\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Query\":{\"offset\":0,\"group_by\":1,\"columns\":[\"user_id\",\"name\",\"email\",\"user_group_id\",\"access_groups\",\"start_datetime\",\"expiry_datetime\",\"operator_level\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"],\"headers\":[\"ID\",\"Name\",\"Email\",\"Group\",\"Access
            Group\",\"Start datetime\",\"End datetime\",\"Operator
            Level\",\"Fingerprint\",\"Face\",\"Visual
            Face\",\"Card\",\"PIN\",\"QR/Barcode\",\"Mobile Access
            Card\",\"Status\"]},\"adv_criteria\":{\"limit\":1000,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            backup\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/csv_export?id=*&adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users/csv_import:
    post:
      tags:
        - User
      summary: Import User Data from CSV
      operationId: importUserCsvImport
      description: >-
        This API is used to import User Data from a .csv file to the BioStar X
        database.


        To run this API successfully, it is imperative to run POST
        `/api/attachments` first to upload the *.csv* file to the server install
        path.


        After *.csv* file got uploaded to the server, put the filename value
        from the above API to the uri and fileName parameter on this API.


        Fields listed on Query parameter are also used for field mapping between
        *.csv* file and BioStar X database.


        For example field user_id on Query:headers (*.csv*) will be matched with
        the first field of Query:columns (BioStar X). To change this mapping,
        adjust the sequence on Query:headers as desired (eg. exchange field
        department with user_id so the value of department will be used on
        user_id on BioStar X).


        To skip a field from mapping, put empty string ("") on the intended
        field.


        If there's no issue on the import process, the API will shows "Success"
        response.  

        If there's issue (duplicate email, etc.), the response will show that
        the "Request is successful but partially" and will include a filename
        which contain records that caused the errors which can be downloaded by
        using GET `/download/:csv_filename`


        If the CSV file to import contains data for custom user fields and the
        fields do not exist on the server, then the data for the fields will be
        ignored during the import process.


        To enter user information in a language other than English or Korean,
        save the CSV file in UTF-8 format.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCsvImportInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/users/csv_import \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"File":{"uri":"User_Test.csv","fileName":"User_Test.csv"},"CsvOption":{"start_line":2,"import_option":1},"Query":{"headers":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","","","","qr","26 bit SIA Standard-H10301","HID 37 bit-H10302","","","","Purpose","License Plate Number","Hello","Hair Color","Hair Color 2","","",""],"columns":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","mobile_start_datetime","mobile_expiry_datetime","csn_mobile","qr","26 bit SIA Standard-H10301","HID 37 bit-H10302","HID 37 bit-H10304","HID Corporate 1000","HID Corporate 1000 48bit","face_image_file1","face_image_file2","pin","login_id","access_groups","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"File":{"uri":"User_Test.csv","fileName":"User_Test.csv"},"CsvOption":{"start_line":2,"import_option":1},"Query":{"headers":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","","","","qr","26
            bit SIA Standard-H10301","HID 37
            bit-H10302","","","","Purpose","License Plate Number","Hello","Hair
            Color","Hair Color
            2","","",""],"columns":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","mobile_start_datetime","mobile_expiry_datetime","csn_mobile","qr","26
            bit SIA Standard-H10301","HID 37 bit-H10302","HID 37
            bit-H10304","HID Corporate 1000","HID Corporate 1000
            48bit","face_image_file1","face_image_file2","pin","login_id","access_groups","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"]}}'
            |  \
              http POST https://{baseurl}/api/users/csv_import \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"File":{"uri":"User_Test.csv","fileName":"User_Test.csv"},"CsvOption":{"start_line":2,"import_option":1},"Query":{"headers":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","","","","qr","26 bit SIA Standard-H10301","HID 37 bit-H10302","","","","Purpose","License Plate Number","Hello","Hair Color","Hair Color 2","","",""],"columns":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","mobile_start_datetime","mobile_expiry_datetime","csn_mobile","qr","26 bit SIA Standard-H10301","HID 37 bit-H10302","HID 37 bit-H10304","HID Corporate 1000","HID Corporate 1000 48bit","face_image_file1","face_image_file2","pin","login_id","access_groups","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"]}}' \
              --output-document \
              - https://{baseurl}/api/users/csv_import
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/csv_import",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              File: {uri: 'User_Test.csv', fileName: 'User_Test.csv'},
              CsvOption: {start_line: 2, import_option: 1},
              Query: {
                headers: [
                  'user_id',
                  'name',
                  'department',
                  'user_title',
                  'phone',
                  'email',
                  'user_group',
                  'start_datetime',
                  'expiry_datetime',
                  'csn',
                  '',
                  '',
                  '',
                  'qr',
                  '26 bit SIA Standard-H10301',
                  'HID 37 bit-H10302',
                  '',
                  '',
                  '',
                  'Purpose',
                  'License Plate Number',
                  'Hello',
                  'Hair Color',
                  'Hair Color 2',
                  '',
                  '',
                  ''
                ],
                columns: [
                  'user_id',
                  'name',
                  'department',
                  'user_title',
                  'phone',
                  'email',
                  'user_group',
                  'start_datetime',
                  'expiry_datetime',
                  'csn',
                  'mobile_start_datetime',
                  'mobile_expiry_datetime',
                  'csn_mobile',
                  'qr',
                  '26 bit SIA Standard-H10301',
                  'HID 37 bit-H10302',
                  'HID 37 bit-H10304',
                  'HID Corporate 1000',
                  'HID Corporate 1000 48bit',
                  'face_image_file1',
                  'face_image_file2',
                  'pin',
                  'login_id',
                  'access_groups',
                  'fingerprint_template_count',
                  'face_count',
                  'visual_face_count',
                  'card_count',
                  'have_pin',
                  'qr_count',
                  'mobile_count',
                  'disabled'
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/csv_import',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                File: {uri: 'User_Test.csv', fileName: 'User_Test.csv'},
                CsvOption: {start_line: 2, import_option: 1},
                Query: {
                  headers: [
                    'user_id',
                    'name',
                    'department',
                    'user_title',
                    'phone',
                    'email',
                    'user_group',
                    'start_datetime',
                    'expiry_datetime',
                    'csn',
                    '',
                    '',
                    '',
                    'qr',
                    '26 bit SIA Standard-H10301',
                    'HID 37 bit-H10302',
                    '',
                    '',
                    '',
                    'Purpose',
                    'License Plate Number',
                    'Hello',
                    'Hair Color',
                    'Hair Color 2',
                    '',
                    '',
                    ''
                  ],
                  columns: [
                    'user_id',
                    'name',
                    'department',
                    'user_title',
                    'phone',
                    'email',
                    'user_group',
                    'start_datetime',
                    'expiry_datetime',
                    'csn',
                    'mobile_start_datetime',
                    'mobile_expiry_datetime',
                    'csn_mobile',
                    'qr',
                    '26 bit SIA Standard-H10301',
                    'HID 37 bit-H10302',
                    'HID 37 bit-H10304',
                    'HID Corporate 1000',
                    'HID Corporate 1000 48bit',
                    'face_image_file1',
                    'face_image_file2',
                    'pin',
                    'login_id',
                    'access_groups',
                    'fingerprint_template_count',
                    'face_count',
                    'visual_face_count',
                    'card_count',
                    'have_pin',
                    'qr_count',
                    'mobile_count',
                    'disabled'
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/users/csv_import");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "File": {
                "uri": "User_Test.csv",
                "fileName": "User_Test.csv"
              },
              "CsvOption": {
                "start_line": 2,
                "import_option": 1
              },
              "Query": {
                "headers": [
                  "user_id",
                  "name",
                  "department",
                  "user_title",
                  "phone",
                  "email",
                  "user_group",
                  "start_datetime",
                  "expiry_datetime",
                  "csn",
                  "",
                  "",
                  "",
                  "qr",
                  "26 bit SIA Standard-H10301",
                  "HID 37 bit-H10302",
                  "",
                  "",
                  "",
                  "Purpose",
                  "License Plate Number",
                  "Hello",
                  "Hair Color",
                  "Hair Color 2",
                  "",
                  "",
                  ""
                ],
                "columns": [
                  "user_id",
                  "name",
                  "department",
                  "user_title",
                  "phone",
                  "email",
                  "user_group",
                  "start_datetime",
                  "expiry_datetime",
                  "csn",
                  "mobile_start_datetime",
                  "mobile_expiry_datetime",
                  "csn_mobile",
                  "qr",
                  "26 bit SIA Standard-H10301",
                  "HID 37 bit-H10302",
                  "HID 37 bit-H10304",
                  "HID Corporate 1000",
                  "HID Corporate 1000 48bit",
                  "face_image_file1",
                  "face_image_file2",
                  "pin",
                  "login_id",
                  "access_groups",
                  "fingerprint_template_count",
                  "face_count",
                  "visual_face_count",
                  "card_count",
                  "have_pin",
                  "qr_count",
                  "mobile_count",
                  "disabled"
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/csv_import',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                File: {uri: 'User_Test.csv', fileName: 'User_Test.csv'},
                CsvOption: {start_line: 2, import_option: 1},
                Query: {
                  headers: [
                    'user_id',
                    'name',
                    'department',
                    'user_title',
                    'phone',
                    'email',
                    'user_group',
                    'start_datetime',
                    'expiry_datetime',
                    'csn',
                    '',
                    '',
                    '',
                    'qr',
                    '26 bit SIA Standard-H10301',
                    'HID 37 bit-H10302',
                    '',
                    '',
                    '',
                    'Purpose',
                    'License Plate Number',
                    'Hello',
                    'Hair Color',
                    'Hair Color 2',
                    '',
                    '',
                    ''
                  ],
                  columns: [
                    'user_id',
                    'name',
                    'department',
                    'user_title',
                    'phone',
                    'email',
                    'user_group',
                    'start_datetime',
                    'expiry_datetime',
                    'csn',
                    'mobile_start_datetime',
                    'mobile_expiry_datetime',
                    'csn_mobile',
                    'qr',
                    '26 bit SIA Standard-H10301',
                    'HID 37 bit-H10302',
                    'HID 37 bit-H10304',
                    'HID Corporate 1000',
                    'HID Corporate 1000 48bit',
                    'face_image_file1',
                    'face_image_file2',
                    'pin',
                    'login_id',
                    'access_groups',
                    'fingerprint_template_count',
                    'face_count',
                    'visual_face_count',
                    'card_count',
                    'have_pin',
                    'qr_count',
                    'mobile_count',
                    'disabled'
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/users/csv_import';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"File":{"uri":"User_Test.csv","fileName":"User_Test.csv"},"CsvOption":{"start_line":2,"import_option":1},"Query":{"headers":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","","","","qr","26 bit SIA Standard-H10301","HID 37 bit-H10302","","","","Purpose","License Plate Number","Hello","Hair Color","Hair Color 2","","",""],"columns":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","mobile_start_datetime","mobile_expiry_datetime","csn_mobile","qr","26 bit SIA Standard-H10301","HID 37 bit-H10302","HID 37 bit-H10304","HID Corporate 1000","HID Corporate 1000 48bit","face_image_file1","face_image_file2","pin","login_id","access_groups","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"File":{"uri":"User_Test.csv","fileName":"User_Test.csv"},"CsvOption":{"start_line":2,"import_option":1},"Query":{"headers":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","","","","qr","26 bit SIA Standard-H10301","HID 37 bit-H10302","","","","Purpose","License Plate Number","Hello","Hair Color","Hair Color 2","","",""],"columns":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","mobile_start_datetime","mobile_expiry_datetime","csn_mobile","qr","26 bit SIA Standard-H10301","HID 37 bit-H10302","HID 37 bit-H10304","HID Corporate 1000","HID Corporate 1000 48bit","face_image_file1","face_image_file2","pin","login_id","access_groups","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"]}}'
            };

            fetch('https://{baseurl}/api/users/csv_import', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/csv_import",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26 bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate Number\",\"Hello\",\"Hair Color\",\"Hair Color 2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26 bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37 bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000 48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "File": {
                "uri": "User_Test.csv",
                "fileName": "User_Test.csv"
              },
              "CsvOption": {
                "start_line": 2,
                "import_option": 1
              },
              "Query": {
                "headers": [
                  "user_id",
                  "name",
                  "department",
                  "user_title",
                  "phone",
                  "email",
                  "user_group",
                  "start_datetime",
                  "expiry_datetime",
                  "csn",
                  "",
                  "",
                  "",
                  "qr",
                  "26 bit SIA Standard-H10301",
                  "HID 37 bit-H10302",
                  "",
                  "",
                  "",
                  "Purpose",
                  "License Plate Number",
                  "Hello",
                  "Hair Color",
                  "Hair Color 2",
                  "",
                  "",
                  ""
                ],
                "columns": [
                  "user_id",
                  "name",
                  "department",
                  "user_title",
                  "phone",
                  "email",
                  "user_group",
                  "start_datetime",
                  "expiry_datetime",
                  "csn",
                  "mobile_start_datetime",
                  "mobile_expiry_datetime",
                  "csn_mobile",
                  "qr",
                  "26 bit SIA Standard-H10301",
                  "HID 37 bit-H10302",
                  "HID 37 bit-H10304",
                  "HID Corporate 1000",
                  "HID Corporate 1000 48bit",
                  "face_image_file1",
                  "face_image_file2",
                  "pin",
                  "login_id",
                  "access_groups",
                  "fingerprint_template_count",
                  "face_count",
                  "visual_face_count",
                  "card_count",
                  "have_pin",
                  "qr_count",
                  "mobile_count",
                  "disabled"
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/users/csv_import");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37
            bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate
            Number\",\"Hello\",\"Hair Color\",\"Hair Color
            2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37
            bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000
            48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/users/csv_import", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/csv_import"


            payload = {
                "File": {
                    "uri": "User_Test.csv",
                    "fileName": "User_Test.csv"
                },
                "CsvOption": {
                    "start_line": 2,
                    "import_option": 1
                },
                "Query": {
                    "headers": ["user_id", "name", "department", "user_title", "phone", "email", "user_group", "start_datetime", "expiry_datetime", "csn", "", "", "", "qr", "26 bit SIA Standard-H10301", "HID 37 bit-H10302", "", "", "", "Purpose", "License Plate Number", "Hello", "Hair Color", "Hair Color 2", "", "", ""],
                    "columns": ["user_id", "name", "department", "user_title", "phone", "email", "user_group", "start_datetime", "expiry_datetime", "csn", "mobile_start_datetime", "mobile_expiry_datetime", "csn_mobile", "qr", "26 bit SIA Standard-H10301", "HID 37 bit-H10302", "HID 37 bit-H10304", "HID Corporate 1000", "HID Corporate 1000 48bit", "face_image_file1", "face_image_file2", "pin", "login_id", "access_groups", "fingerprint_template_count", "face_count", "visual_face_count", "card_count", "have_pin", "qr_count", "mobile_count", "disabled"]
                }
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/users/csv_import")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37
            bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate
            Number\",\"Hello\",\"Hair Color\",\"Hair Color
            2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37
            bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000
            48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/csv_import",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26 bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate Number\",\"Hello\",\"Hair Color\",\"Hair Color 2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26 bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37 bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000 48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/csv_import');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"File":{"uri":"User_Test.csv","fileName":"User_Test.csv"},"CsvOption":{"start_line":2,"import_option":1},"Query":{"headers":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","","","","qr","26
            bit SIA Standard-H10301","HID 37
            bit-H10302","","","","Purpose","License Plate Number","Hello","Hair
            Color","Hair Color
            2","","",""],"columns":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","mobile_start_datetime","mobile_expiry_datetime","csn_mobile","qr","26
            bit SIA Standard-H10301","HID 37 bit-H10302","HID 37
            bit-H10304","HID Corporate 1000","HID Corporate 1000
            48bit","face_image_file1","face_image_file2","pin","login_id","access_groups","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"File":{"uri":"User_Test.csv","fileName":"User_Test.csv"},"CsvOption":{"start_line":2,"import_option":1},"Query":{"headers":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","","","","qr","26
            bit SIA Standard-H10301","HID 37
            bit-H10302","","","","Purpose","License Plate Number","Hello","Hair
            Color","Hair Color
            2","","",""],"columns":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","mobile_start_datetime","mobile_expiry_datetime","csn_mobile","qr","26
            bit SIA Standard-H10301","HID 37 bit-H10302","HID 37
            bit-H10304","HID Corporate 1000","HID Corporate 1000
            48bit","face_image_file1","face_image_file2","pin","login_id","access_groups","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"]}}');


            $request->setRequestUrl('https://{baseurl}/api/users/csv_import');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37
            bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate
            Number\",\"Hello\",\"Hair Color\",\"Hair Color
            2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37
            bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000
            48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/csv_import")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/users/csv_import")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26 bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate Number\",\"Hello\",\"Hair Color\",\"Hair Color 2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26 bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37 bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000 48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/csv_import\"\n\n\tpayload := strings.NewReader(\"{\\\"File\\\":{\\\"uri\\\":\\\"User_Test.csv\\\",\\\"fileName\\\":\\\"User_Test.csv\\\"},\\\"CsvOption\\\":{\\\"start_line\\\":2,\\\"import_option\\\":1},\\\"Query\\\":{\\\"headers\\\":[\\\"user_id\\\",\\\"name\\\",\\\"department\\\",\\\"user_title\\\",\\\"phone\\\",\\\"email\\\",\\\"user_group\\\",\\\"start_datetime\\\",\\\"expiry_datetime\\\",\\\"csn\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"qr\\\",\\\"26 bit SIA Standard-H10301\\\",\\\"HID 37 bit-H10302\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"Purpose\\\",\\\"License Plate Number\\\",\\\"Hello\\\",\\\"Hair Color\\\",\\\"Hair Color 2\\\",\\\"\\\",\\\"\\\",\\\"\\\"],\\\"columns\\\":[\\\"user_id\\\",\\\"name\\\",\\\"department\\\",\\\"user_title\\\",\\\"phone\\\",\\\"email\\\",\\\"user_group\\\",\\\"start_datetime\\\",\\\"expiry_datetime\\\",\\\"csn\\\",\\\"mobile_start_datetime\\\",\\\"mobile_expiry_datetime\\\",\\\"csn_mobile\\\",\\\"qr\\\",\\\"26 bit SIA Standard-H10301\\\",\\\"HID 37 bit-H10302\\\",\\\"HID 37 bit-H10304\\\",\\\"HID Corporate 1000\\\",\\\"HID Corporate 1000 48bit\\\",\\\"face_image_file1\\\",\\\"face_image_file2\\\",\\\"pin\\\",\\\"login_id\\\",\\\"access_groups\\\",\\\"fingerprint_template_count\\\",\\\"face_count\\\",\\\"visual_face_count\\\",\\\"card_count\\\",\\\"have_pin\\\",\\\"qr_count\\\",\\\"mobile_count\\\",\\\"disabled\\\"]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/csv_import");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37
            bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate
            Number\",\"Hello\",\"Hair Color\",\"Hair Color
            2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37
            bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000
            48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"File": @{ @"uri": @"User_Test.csv",
            @"fileName": @"User_Test.csv" },
                                          @"CsvOption": @{ @"start_line": @2, @"import_option": @1 },
                                          @"Query": @{ @"headers": @[ @"user_id", @"name", @"department", @"user_title", @"phone", @"email", @"user_group", @"start_datetime", @"expiry_datetime", @"csn", @"", @"", @"", @"qr", @"26 bit SIA Standard-H10301", @"HID 37 bit-H10302", @"", @"", @"", @"Purpose", @"License Plate Number", @"Hello", @"Hair Color", @"Hair Color 2", @"", @"", @"" ], @"columns": @[ @"user_id", @"name", @"department", @"user_title", @"phone", @"email", @"user_group", @"start_datetime", @"expiry_datetime", @"csn", @"mobile_start_datetime", @"mobile_expiry_datetime", @"csn_mobile", @"qr", @"26 bit SIA Standard-H10301", @"HID 37 bit-H10302", @"HID 37 bit-H10304", @"HID Corporate 1000", @"HID Corporate 1000 48bit", @"face_image_file1", @"face_image_file2", @"pin", @"login_id", @"access_groups", @"fingerprint_template_count", @"face_count", @"visual_face_count", @"card_count", @"have_pin", @"qr_count", @"mobile_count", @"disabled" ] } };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/csv_import"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "File": [
                "uri": "User_Test.csv",
                "fileName": "User_Test.csv"
              ],
              "CsvOption": [
                "start_line": 2,
                "import_option": 1
              ],
              "Query": [
                "headers": ["user_id", "name", "department", "user_title", "phone", "email", "user_group", "start_datetime", "expiry_datetime", "csn", "", "", "", "qr", "26 bit SIA Standard-H10301", "HID 37 bit-H10302", "", "", "", "Purpose", "License Plate Number", "Hello", "Hair Color", "Hair Color 2", "", "", ""],
                "columns": ["user_id", "name", "department", "user_title", "phone", "email", "user_group", "start_datetime", "expiry_datetime", "csn", "mobile_start_datetime", "mobile_expiry_datetime", "csn_mobile", "qr", "26 bit SIA Standard-H10301", "HID 37 bit-H10302", "HID 37 bit-H10304", "HID Corporate 1000", "HID Corporate 1000 48bit", "face_image_file1", "face_image_file2", "pin", "login_id", "access_groups", "fingerprint_template_count", "face_count", "visual_face_count", "card_count", "have_pin", "qr_count", "mobile_count", "disabled"]
              ]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/csv_import")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/csv_import");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37
            bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate
            Number\",\"Hello\",\"Hair Color\",\"Hair Color
            2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37
            bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000
            48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/users/csv_import"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26 bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate Number\",\"Hello\",\"Hair Color\",\"Hair Color 2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26 bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37 bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000 48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/csv_import' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"File":{"uri":"User_Test.csv","fileName":"User_Test.csv"},"CsvOption":{"start_line":2,"import_option":1},"Query":{"headers":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","","","","qr","26
            bit SIA Standard-H10301","HID 37
            bit-H10302","","","","Purpose","License Plate Number","Hello","Hair
            Color","Hair Color
            2","","",""],"columns":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","mobile_start_datetime","mobile_expiry_datetime","csn_mobile","qr","26
            bit SIA Standard-H10301","HID 37 bit-H10302","HID 37
            bit-H10304","HID Corporate 1000","HID Corporate 1000
            48bit","face_image_file1","face_image_file2","pin","login_id","access_groups","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/csv_import' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"File":{"uri":"User_Test.csv","fileName":"User_Test.csv"},"CsvOption":{"start_line":2,"import_option":1},"Query":{"headers":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","","","","qr","26
            bit SIA Standard-H10301","HID 37
            bit-H10302","","","","Purpose","License Plate Number","Hello","Hair
            Color","Hair Color
            2","","",""],"columns":["user_id","name","department","user_title","phone","email","user_group","start_datetime","expiry_datetime","csn","mobile_start_datetime","mobile_expiry_datetime","csn_mobile","qr","26
            bit SIA Standard-H10301","HID 37 bit-H10302","HID 37
            bit-H10304","HID Corporate 1000","HID Corporate 1000
            48bit","face_image_file1","face_image_file2","pin","login_id","access_groups","fingerprint_template_count","face_count","visual_face_count","card_count","have_pin","qr_count","mobile_count","disabled"]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/csv_import"


            payload <-
            "{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37
            bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate
            Number\",\"Hello\",\"Hair Color\",\"Hair Color
            2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37
            bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000
            48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/users/csv_import" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37
            bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate
            Number\",\"Hello\",\"Hair Color\",\"Hair Color
            2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37
            bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000
            48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"File\":{\"uri\":\"User_Test.csv\",\"fileName\":\"User_Test.csv\"},\"CsvOption\":{\"start_line\":2,\"import_option\":1},\"Query\":{\"headers\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"\",\"\",\"\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37
            bit-H10302\",\"\",\"\",\"\",\"Purpose\",\"License Plate
            Number\",\"Hello\",\"Hair Color\",\"Hair Color
            2\",\"\",\"\",\"\"],\"columns\":[\"user_id\",\"name\",\"department\",\"user_title\",\"phone\",\"email\",\"user_group\",\"start_datetime\",\"expiry_datetime\",\"csn\",\"mobile_start_datetime\",\"mobile_expiry_datetime\",\"csn_mobile\",\"qr\",\"26
            bit SIA Standard-H10301\",\"HID 37 bit-H10302\",\"HID 37
            bit-H10304\",\"HID Corporate 1000\",\"HID Corporate 1000
            48bit\",\"face_image_file1\",\"face_image_file2\",\"pin\",\"login_id\",\"access_groups\",\"fingerprint_template_count\",\"face_count\",\"visual_face_count\",\"card_count\",\"have_pin\",\"qr_count\",\"mobile_count\",\"disabled\"]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/csv_import")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users/data_export:
    post:
      tags:
        - User
      summary: Data File Export
      operationId: exportUserDataExport
      description: >-
        You can store the data file on external storage (USB) and import to
        BioStar X or device. Up to 500,000 users can be moved from server to
        device or from device to device.


        - The exported data file from devices using older firmware version
        cannot be imported into BioStar X. Make sure always use the latest
        version of firmware.
            
        - If you use BioStar 2.8.10 or later, data exported from the previous
        version of BioStar 2 cannot be imported.
            
        - If you use BioStar 2.8.10 or later, it is impossible to read data from
        a device that are using older firmware version. Upgrade the device’s
        firmware to a compatible version. Compatible devices and firmware
        versions are as follows:
            
            - BioStation 2 FW 1.9.0 or later > device_type: 8
                
            - BioStation A2 FW 1.8.0 or later > device_type: 9
                
            - FaceStation 2 FW 1.4.0 or later > device_type: 10
                
            - FaceStation F2 FW 1.0.0 or later > device_type: 29
                
            - X-Station 2 FW 1.0.0 or later > device_type: 32
                
        - If the fingerprint template format is different, the data file cannot
        be imported. For example, the data file exported from a device which
        uses the Suprema fingerprint template format cannot be imported into a
        device which uses the ISO fingerprint template format.
            
        - When importing user data with visual faces enrolled from FaceStation
        F2, the existing data will be retained if there are already visual face
        data enrolled on BioStar 2 via Upload Image or a mobile device.

        - The exported data file includes the profile photo, user ID, name,
        period, access group, PIN, auth. mode, credentials (face, fingerprint,
        card, mobile access card, visual face, BioStar 2 QR, QR/Barcode), 1:1
        security level.
            
        - You can export visual face data directly registered from the device
        only. It is not possible to export the data registered with the other
        methods, such as image file upload, CSV import, and mobile devices.
            
        - Be sure that the device is selected correctly. Otherwise, the device
        cannot recognize the data file.
      parameters:
        - name: id
          in: query
          schema:
            type: string
          description: User ID(s) to export. Use space as separator for multiple users.
          example: 14 15 16
        - name: adv
          in: query
          schema:
            type: string
          description: Enable Advanced Search query mode
          example: mode1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserDataExportInput'
      responses:
        '200':
          description: Export completed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  File:
                    type: object
                    properties:
                      uri:
                        type: string
                        description: Generated export file name
                        example: BioStar2_20241103_143708.tgz
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"device_type":35,"group_id":1,"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For device migration"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"device_type":35,"group_id":1,"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For
            device migration"}' |  \
              http POST 'https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"device_type":35,"group_id":1,"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For device migration"}' \
              --output-document \
              - 'https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              device_type: 35,
              group_id: 1,
              adv_criteria: {
                limit: 50,
                offset: 0,
                user_id: '11',
                order_by: 'user_id:false',
                user_group_id: 1,
                user_group_ids: [1121],
                user_name: 'John',
                user_email: 'abc@gmail.com',
                user_phone: '123-456-7890',
                user_access_group_ids: '17,18',
                user_operator_level_id: 0,
                user_department: 'Engineering',
                user_title: 'Manager',
                user_card: '123456',
                user_custom_field_1: 'string',
                user_custom_field_2: 'string',
                user_custom_field_3: 'string',
                user_custom_field_4: 'string',
                user_custom_field_5: 'string',
                user_custom_field_6: 'string',
                user_custom_field_7: 'string',
                user_custom_field_8: 'string',
                user_custom_field_9: 'string',
                user_custom_field_10: 'string',
                user_status: false
              },
              reason: 'For device migration'
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/data_export',
              qs: {id: '14 15 16', adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                device_type: 35,
                group_id: 1,
                adv_criteria: {
                  limit: 50,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                },
                reason: 'For device migration'
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/users/data_export");


            req.query({
              "id": "14 15 16",
              "adv": "mode1"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "device_type": 35,
              "group_id": 1,
              "adv_criteria": {
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              },
              "reason": "For device migration"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/data_export',
              params: {id: '14 15 16', adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                device_type: 35,
                group_id: 1,
                adv_criteria: {
                  limit: 50,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                },
                reason: 'For device migration'
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"device_type":35,"group_id":1,"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For device migration"}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"device_type":35,"group_id":1,"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For device migration"}'
            };


            fetch('https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For device migration\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "device_type": 35,
              "group_id": 1,
              "adv_criteria": {
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              },
              "reason": "For device migration"
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            device migration\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/data_export"


            querystring = {"id":"14 15 16","adv":"mode1"}


            payload = {
                "device_type": 35,
                "group_id": 1,
                "adv_criteria": {
                    "limit": 50,
                    "offset": 0,
                    "user_id": "11",
                    "order_by": "user_id:false",
                    "user_group_id": 1,
                    "user_group_ids": [1121],
                    "user_name": "John",
                    "user_email": "abc@gmail.com",
                    "user_phone": "123-456-7890",
                    "user_access_group_ids": "17,18",
                    "user_operator_level_id": 0,
                    "user_department": "Engineering",
                    "user_title": "Manager",
                    "user_card": "123456",
                    "user_custom_field_1": "string",
                    "user_custom_field_2": "string",
                    "user_custom_field_3": "string",
                    "user_custom_field_4": "string",
                    "user_custom_field_5": "string",
                    "user_custom_field_6": "string",
                    "user_custom_field_7": "string",
                    "user_custom_field_8": "string",
                    "user_custom_field_9": "string",
                    "user_custom_field_10": "string",
                    "user_status": False
                },
                "reason": "For device migration"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            device migration\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For device migration\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/data_export');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'id' => '14 15 16',
              'adv' => 'mode1'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"device_type":35,"group_id":1,"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For
            device migration"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"device_type":35,"group_id":1,"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For
            device migration"}');


            $request->setRequestUrl('https://{baseurl}/api/users/data_export');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'id' => '14 15 16',
              'adv' => 'mode1'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            device migration\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For device migration\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1\"\n\n\tpayload := strings.NewReader(\"{\\\"device_type\\\":35,\\\"group_id\\\":1,\\\"adv_criteria\\\":{\\\"limit\\\":50,\\\"offset\\\":0,\\\"user_id\\\":\\\"11\\\",\\\"order_by\\\":\\\"user_id:false\\\",\\\"user_group_id\\\":1,\\\"user_group_ids\\\":[1121],\\\"user_name\\\":\\\"John\\\",\\\"user_email\\\":\\\"abc@gmail.com\\\",\\\"user_phone\\\":\\\"123-456-7890\\\",\\\"user_access_group_ids\\\":\\\"17,18\\\",\\\"user_operator_level_id\\\":0,\\\"user_department\\\":\\\"Engineering\\\",\\\"user_title\\\":\\\"Manager\\\",\\\"user_card\\\":\\\"123456\\\",\\\"user_custom_field_1\\\":\\\"string\\\",\\\"user_custom_field_2\\\":\\\"string\\\",\\\"user_custom_field_3\\\":\\\"string\\\",\\\"user_custom_field_4\\\":\\\"string\\\",\\\"user_custom_field_5\\\":\\\"string\\\",\\\"user_custom_field_6\\\":\\\"string\\\",\\\"user_custom_field_7\\\":\\\"string\\\",\\\"user_custom_field_8\\\":\\\"string\\\",\\\"user_custom_field_9\\\":\\\"string\\\",\\\"user_custom_field_10\\\":\\\"string\\\",\\\"user_status\\\":false},\\\"reason\\\":\\\"For device migration\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            device migration\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"device_type": @35,
                                          @"group_id": @1,
                                          @"adv_criteria": @{ @"limit": @50, @"offset": @0, @"user_id": @"11", @"order_by": @"user_id:false", @"user_group_id": @1, @"user_group_ids": @[ @1121 ], @"user_name": @"John", @"user_email": @"abc@gmail.com", @"user_phone": @"123-456-7890", @"user_access_group_ids": @"17,18", @"user_operator_level_id": @0, @"user_department": @"Engineering", @"user_title": @"Manager", @"user_card": @"123456", @"user_custom_field_1": @"string", @"user_custom_field_2": @"string", @"user_custom_field_3": @"string", @"user_custom_field_4": @"string", @"user_custom_field_5": @"string", @"user_custom_field_6": @"string", @"user_custom_field_7": @"string", @"user_custom_field_8": @"string", @"user_custom_field_9": @"string", @"user_custom_field_10": @"string", @"user_status": @NO },
                                          @"reason": @"For device migration" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "device_type": 35,
              "group_id": 1,
              "adv_criteria": [
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [1121],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              ],
              "reason": "For device migration"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            device migration\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For device migration\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"device_type":35,"group_id":1,"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For
            device migration"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"device_type":35,"group_id":1,"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reason":"For
            device migration"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/data_export"


            queryString <- list(
              id = "14 15 16"
              adv = "mode1",
            )


            payload <-
            "{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            device migration\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            device migration\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"device_type\":35,\"group_id\":1,\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reason\":\"For
            device migration\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/data_export?id=14%2015%2016&adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users/data_import:
    post:
      tags:
        - User
      summary: Data File Import
      operationId: importUserDataImport
      description: >-
        You can store the data file on external storage (USB) and import to
        BioStar 2 or device. Up to 500,000 users can be moved from server to
        device or from device to device.


        * The exported data file from devices using older firmware version
        cannot be imported into BioStar 2. Make sure always use the latest
        version of firmware.

        * If you use BioStar 2.8.10 or later, data exported from the previous
        version of BioStar 2 cannot be imported.

        * If you use BioStar 2.8.10 or later, it is impossible to read data from
        a device that are using older firmware version. Upgrade the device’s
        firmware to a compatible version. Compatible devices and firmware
        versions are as follows:
            
            * BioStation 2 FW 1.9.0 or later > device_type: 8
            
            * BioStation A2 FW 1.8.0 or later > device_type: 9
            
            * FaceStation 2 FW 1.4.0 or later > device_type: 10
            
            * FaceStation F2 FW 1.0.0 or later > device_type: 29
            
            * X-Station 2 FW 1.0.0 or later > device_type: 32

        * If the fingerprint template format is different, the data file cannot
        be imported. For example, the data file exported from a device which
        uses the Suprema fingerprint template format cannot be imported into a
        device which uses the ISO fingerprint template format.

        * When importing user data with visual faces enrolled from FaceStation
        F2, the existing data will be retained if there are already visual face
        data enrolled on BioStar 2 via Upload Image or a mobile device.


        Select the desired file (*.tgz*) and then click Open.


        A success message will appear on the screen when import successfully.

        Use POST `/api/attachments` to upload the file (*.tgz*) to the BioStar 2
        server.

        Use the resulting filename on the response as value on the BODY
        parameter.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserDataImportInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/users/data_import \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"file":{"originalName":"BioStar2_20241103_143708.tgz","name":"BioStar2_20241103_143708.tgz"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"file":{"originalName":"BioStar2_20241103_143708.tgz","name":"BioStar2_20241103_143708.tgz"}}'
            |  \
              http POST https://{baseurl}/api/users/data_import \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"file":{"originalName":"BioStar2_20241103_143708.tgz","name":"BioStar2_20241103_143708.tgz"}}' \
              --output-document \
              - https://{baseurl}/api/users/data_import
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/data_import",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              file: {
                originalName: 'BioStar2_20241103_143708.tgz',
                name: 'BioStar2_20241103_143708.tgz'
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/data_import',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                file: {
                  originalName: 'BioStar2_20241103_143708.tgz',
                  name: 'BioStar2_20241103_143708.tgz'
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/users/data_import");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "file": {
                "originalName": "BioStar2_20241103_143708.tgz",
                "name": "BioStar2_20241103_143708.tgz"
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/data_import',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                file: {
                  originalName: 'BioStar2_20241103_143708.tgz',
                  name: 'BioStar2_20241103_143708.tgz'
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/users/data_import';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"file":{"originalName":"BioStar2_20241103_143708.tgz","name":"BioStar2_20241103_143708.tgz"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"file":{"originalName":"BioStar2_20241103_143708.tgz","name":"BioStar2_20241103_143708.tgz"}}'
            };

            fetch('https://{baseurl}/api/users/data_import', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/data_import",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "file": {
                "originalName": "BioStar2_20241103_143708.tgz",
                "name": "BioStar2_20241103_143708.tgz"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/users/data_import");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/users/data_import", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/data_import"


            payload = {"file": {
                    "originalName": "BioStar2_20241103_143708.tgz",
                    "name": "BioStar2_20241103_143708.tgz"
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/users/data_import")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/data_import",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/data_import');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"file":{"originalName":"BioStar2_20241103_143708.tgz","name":"BioStar2_20241103_143708.tgz"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"file":{"originalName":"BioStar2_20241103_143708.tgz","name":"BioStar2_20241103_143708.tgz"}}');


            $request->setRequestUrl('https://{baseurl}/api/users/data_import');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/data_import")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/users/data_import")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/data_import\"\n\n\tpayload := strings.NewReader(\"{\\\"file\\\":{\\\"originalName\\\":\\\"BioStar2_20241103_143708.tgz\\\",\\\"name\\\":\\\"BioStar2_20241103_143708.tgz\\\"}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/data_import");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"file": @{ @"originalName":
            @"BioStar2_20241103_143708.tgz", @"name":
            @"BioStar2_20241103_143708.tgz" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/data_import"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["file": [
                "originalName": "BioStar2_20241103_143708.tgz",
                "name": "BioStar2_20241103_143708.tgz"
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/data_import")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/data_import");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/users/data_import"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/data_import' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"file":{"originalName":"BioStar2_20241103_143708.tgz","name":"BioStar2_20241103_143708.tgz"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/data_import' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"file":{"originalName":"BioStar2_20241103_143708.tgz","name":"BioStar2_20241103_143708.tgz"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/data_import"


            payload <-
            "{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/users/data_import" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"file\":{\"originalName\":\"BioStar2_20241103_143708.tgz\",\"name\":\"BioStar2_20241103_143708.tgz\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/data_import")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users/report:
    post:
      tags:
        - User
      summary: Export User(s) as PDF/SVG with Advanced Search
      operationId: createUserReport
      description: >-
        Generate customizable user reports in PDF or SVG format using Advanced
        Search criteria.


        **Prerequisites:**

        - Valid Advanced Search criteria must be provided

        - User must have appropriate permissions to generate reports


        **Report Configuration:**

        - Display fields can be customized to show specific user data columns

        - Supports various formatting options (page size, orientation, headers)

        - Includes pagination and footer customization options


        **Output Formats:**

        - PDF: For printable reports with consistent formatting

        - SVG: For web display and scalable graphics
      requestBody:
        required: true
        description: Report configuration and user data criteria
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserReportInput'
            example:
              View:
                Query:
                  collection_name: UserCollection
                  object: query
                  orders:
                    - column: user_id
                      descending: 'false'
                display_fields:
                  - name: user_id
                    display_name: ID
                    display_type: string
                    width: 5
                  - name: name
                    display_name: Name
                    display_type: string
                    width: 9
                  - name: email
                    display_name: Email
                    display_type: string
                    width: 12
                  - name: user_group_id.name
                    display_name: Group
                    display_type: string
                    width: 9
                  - name: access_groups
                    display_name: Access Group
                    display_type: objects
                    width: 9
                  - name: start_datetime
                    display_name: Start datetime
                    display_type: string
                    width: 7
                  - name: expiry_datetime
                    display_name: End datetime
                    display_type: string
                    width: 7
                  - name: operator_level
                    display_name: Operator Level
                    display_type: string
                    width: 9
                  - name: fingerprint_template_count
                    display_name: Fingerprint
                    display_type: string
                    width: 4
                  - name: face_count
                    display_name: Face
                    display_type: string
                    width: 4
                  - name: visual_face_count
                    display_name: Visual Face
                    display_type: string
                    width: 4
                  - name: card_count
                    display_name: Card
                    display_type: string
                    width: 4
                  - name: have_pin
                    display_name: PIN
                    display_type: string
                    width: 4
                  - name: qr_count
                    display_name: QR/Barcode
                    display_type: string
                    width: 4
                  - name: mobile_count
                    display_name: Mobile Access Card
                    display_type: string
                    width: 4
                  - name: disabled
                    display_name: Status
                    display_type: enum
                    width: 2
                    enum:
                      - false=
                      - true=Inactive
                name: All Users
                show_title_every_page: false
                group_by_page_break: false
                footer_report_date: true
                footer_comment: Created by Administrator
                footer_display_page_number: true
                content_type: PDF
                page_size: A4
                page_portrait: false
              adv_criteria:
                limit: 1000
                user_group_ids: []
                user_group_id: 1
                user_operator_level_id: 0
                order_by: user_id:false
      parameters:
        - name: use_centigrade
          in: query
          schema:
            type: boolean
          example: true
        - name: adv
          in: query
          schema:
            type: string
          description: Use this to enable Advanced Search query result.
          example: mode1
      responses:
        '200':
          description: Report generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserReportResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"View":{"Query":{"collection_name":"UserCollection","object":"query","orders":[{"column":"user_id","descending":"false"}]},"display_fields":[{"name":"user_id","display_name":"ID","display_type":"string","width":5,"enum":["false=Active","true=Inactive"]}],"name":"All Users","show_title_every_page":false,"group_by_page_break":false,"footer_report_date":true,"footer_comment":"Created by Administrator","footer_display_page_number":true,"content_type":"PDF","page_size":"A4","page_portrait":false},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reaseon":"For audit purposes"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"View":{"Query":{"collection_name":"UserCollection","object":"query","orders":[{"column":"user_id","descending":"false"}]},"display_fields":[{"name":"user_id","display_name":"ID","display_type":"string","width":5,"enum":["false=Active","true=Inactive"]}],"name":"All
            Users","show_title_every_page":false,"group_by_page_break":false,"footer_report_date":true,"footer_comment":"Created
            by
            Administrator","footer_display_page_number":true,"content_type":"PDF","page_size":"A4","page_portrait":false},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reaseon":"For
            audit purposes"}' |  \
              http POST 'https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"View":{"Query":{"collection_name":"UserCollection","object":"query","orders":[{"column":"user_id","descending":"false"}]},"display_fields":[{"name":"user_id","display_name":"ID","display_type":"string","width":5,"enum":["false=Active","true=Inactive"]}],"name":"All Users","show_title_every_page":false,"group_by_page_break":false,"footer_report_date":true,"footer_comment":"Created by Administrator","footer_display_page_number":true,"content_type":"PDF","page_size":"A4","page_portrait":false},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reaseon":"For audit purposes"}' \
              --output-document \
              - 'https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users/report?use_centigrade=true&adv=mode1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              View: {
                Query: {
                  collection_name: 'UserCollection',
                  object: 'query',
                  orders: [{column: 'user_id', descending: 'false'}]
                },
                display_fields: [
                  {
                    name: 'user_id',
                    display_name: 'ID',
                    display_type: 'string',
                    width: 5,
                    enum: ['false=Active', 'true=Inactive']
                  }
                ],
                name: 'All Users',
                show_title_every_page: false,
                group_by_page_break: false,
                footer_report_date: true,
                footer_comment: 'Created by Administrator',
                footer_display_page_number: true,
                content_type: 'PDF',
                page_size: 'A4',
                page_portrait: false
              },
              adv_criteria: {
                limit: 50,
                offset: 0,
                user_id: '11',
                order_by: 'user_id:false',
                user_group_id: 1,
                user_group_ids: [1121],
                user_name: 'John',
                user_email: 'abc@gmail.com',
                user_phone: '123-456-7890',
                user_access_group_ids: '17,18',
                user_operator_level_id: 0,
                user_department: 'Engineering',
                user_title: 'Manager',
                user_card: '123456',
                user_custom_field_1: 'string',
                user_custom_field_2: 'string',
                user_custom_field_3: 'string',
                user_custom_field_4: 'string',
                user_custom_field_5: 'string',
                user_custom_field_6: 'string',
                user_custom_field_7: 'string',
                user_custom_field_8: 'string',
                user_custom_field_9: 'string',
                user_custom_field_10: 'string',
                user_status: false
              },
              reaseon: 'For audit purposes'
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/report',
              qs: {use_centigrade: 'true', adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                View: {
                  Query: {
                    collection_name: 'UserCollection',
                    object: 'query',
                    orders: [{column: 'user_id', descending: 'false'}]
                  },
                  display_fields: [
                    {
                      name: 'user_id',
                      display_name: 'ID',
                      display_type: 'string',
                      width: 5,
                      enum: ['false=Active', 'true=Inactive']
                    }
                  ],
                  name: 'All Users',
                  show_title_every_page: false,
                  group_by_page_break: false,
                  footer_report_date: true,
                  footer_comment: 'Created by Administrator',
                  footer_display_page_number: true,
                  content_type: 'PDF',
                  page_size: 'A4',
                  page_portrait: false
                },
                adv_criteria: {
                  limit: 50,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                },
                reaseon: 'For audit purposes'
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/users/report");

            req.query({
              "use_centigrade": "true",
              "adv": "mode1"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "View": {
                "Query": {
                  "collection_name": "UserCollection",
                  "object": "query",
                  "orders": [
                    {
                      "column": "user_id",
                      "descending": "false"
                    }
                  ]
                },
                "display_fields": [
                  {
                    "name": "user_id",
                    "display_name": "ID",
                    "display_type": "string",
                    "width": 5,
                    "enum": [
                      "false=Active",
                      "true=Inactive"
                    ]
                  }
                ],
                "name": "All Users",
                "show_title_every_page": false,
                "group_by_page_break": false,
                "footer_report_date": true,
                "footer_comment": "Created by Administrator",
                "footer_display_page_number": true,
                "content_type": "PDF",
                "page_size": "A4",
                "page_portrait": false
              },
              "adv_criteria": {
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              },
              "reaseon": "For audit purposes"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users/report',
              params: {use_centigrade: 'true', adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                View: {
                  Query: {
                    collection_name: 'UserCollection',
                    object: 'query',
                    orders: [{column: 'user_id', descending: 'false'}]
                  },
                  display_fields: [
                    {
                      name: 'user_id',
                      display_name: 'ID',
                      display_type: 'string',
                      width: 5,
                      enum: ['false=Active', 'true=Inactive']
                    }
                  ],
                  name: 'All Users',
                  show_title_every_page: false,
                  group_by_page_break: false,
                  footer_report_date: true,
                  footer_comment: 'Created by Administrator',
                  footer_display_page_number: true,
                  content_type: 'PDF',
                  page_size: 'A4',
                  page_portrait: false
                },
                adv_criteria: {
                  limit: 50,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                },
                reaseon: 'For audit purposes'
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"View":{"Query":{"collection_name":"UserCollection","object":"query","orders":[{"column":"user_id","descending":"false"}]},"display_fields":[{"name":"user_id","display_name":"ID","display_type":"string","width":5,"enum":["false=Active","true=Inactive"]}],"name":"All Users","show_title_every_page":false,"group_by_page_break":false,"footer_report_date":true,"footer_comment":"Created by Administrator","footer_display_page_number":true,"content_type":"PDF","page_size":"A4","page_portrait":false},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reaseon":"For audit purposes"}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"View":{"Query":{"collection_name":"UserCollection","object":"query","orders":[{"column":"user_id","descending":"false"}]},"display_fields":[{"name":"user_id","display_name":"ID","display_type":"string","width":5,"enum":["false=Active","true=Inactive"]}],"name":"All Users","show_title_every_page":false,"group_by_page_break":false,"footer_report_date":true,"footer_comment":"Created by Administrator","footer_display_page_number":true,"content_type":"PDF","page_size":"A4","page_portrait":false},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reaseon":"For audit purposes"}'
            };


            fetch('https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created by Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For audit purposes\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "View": {
                "Query": {
                  "collection_name": "UserCollection",
                  "object": "query",
                  "orders": [
                    {
                      "column": "user_id",
                      "descending": "false"
                    }
                  ]
                },
                "display_fields": [
                  {
                    "name": "user_id",
                    "display_name": "ID",
                    "display_type": "string",
                    "width": 5,
                    "enum": [
                      "false=Active",
                      "true=Inactive"
                    ]
                  }
                ],
                "name": "All Users",
                "show_title_every_page": false,
                "group_by_page_break": false,
                "footer_report_date": true,
                "footer_comment": "Created by Administrator",
                "footer_display_page_number": true,
                "content_type": "PDF",
                "page_size": "A4",
                "page_portrait": false
              },
              "adv_criteria": {
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              },
              "reaseon": "For audit purposes"
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All
            Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created
            by
            Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For
            audit purposes\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/users/report?use_centigrade=true&adv=mode1", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users/report"


            querystring = {"use_centigrade":"true","adv":"mode1"}


            payload = {
                "View": {
                    "Query": {
                        "collection_name": "UserCollection",
                        "object": "query",
                        "orders": [
                            {
                                "column": "user_id",
                                "descending": "false"
                            }
                        ]
                    },
                    "display_fields": [
                        {
                            "name": "user_id",
                            "display_name": "ID",
                            "display_type": "string",
                            "width": 5,
                            "enum": ["false=Active", "true=Inactive"]
                        }
                    ],
                    "name": "All Users",
                    "show_title_every_page": False,
                    "group_by_page_break": False,
                    "footer_report_date": True,
                    "footer_comment": "Created by Administrator",
                    "footer_display_page_number": True,
                    "content_type": "PDF",
                    "page_size": "A4",
                    "page_portrait": False
                },
                "adv_criteria": {
                    "limit": 50,
                    "offset": 0,
                    "user_id": "11",
                    "order_by": "user_id:false",
                    "user_group_id": 1,
                    "user_group_ids": [1121],
                    "user_name": "John",
                    "user_email": "abc@gmail.com",
                    "user_phone": "123-456-7890",
                    "user_access_group_ids": "17,18",
                    "user_operator_level_id": 0,
                    "user_department": "Engineering",
                    "user_title": "Manager",
                    "user_card": "123456",
                    "user_custom_field_1": "string",
                    "user_custom_field_2": "string",
                    "user_custom_field_3": "string",
                    "user_custom_field_4": "string",
                    "user_custom_field_5": "string",
                    "user_custom_field_6": "string",
                    "user_custom_field_7": "string",
                    "user_custom_field_8": "string",
                    "user_custom_field_9": "string",
                    "user_custom_field_10": "string",
                    "user_status": False
                },
                "reaseon": "For audit purposes"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All
            Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created
            by
            Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For
            audit purposes\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created by Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For audit purposes\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users/report');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'use_centigrade' => 'true',
              'adv' => 'mode1'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"View":{"Query":{"collection_name":"UserCollection","object":"query","orders":[{"column":"user_id","descending":"false"}]},"display_fields":[{"name":"user_id","display_name":"ID","display_type":"string","width":5,"enum":["false=Active","true=Inactive"]}],"name":"All
            Users","show_title_every_page":false,"group_by_page_break":false,"footer_report_date":true,"footer_comment":"Created
            by
            Administrator","footer_display_page_number":true,"content_type":"PDF","page_size":"A4","page_portrait":false},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reaseon":"For
            audit purposes"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"View":{"Query":{"collection_name":"UserCollection","object":"query","orders":[{"column":"user_id","descending":"false"}]},"display_fields":[{"name":"user_id","display_name":"ID","display_type":"string","width":5,"enum":["false=Active","true=Inactive"]}],"name":"All
            Users","show_title_every_page":false,"group_by_page_break":false,"footer_report_date":true,"footer_comment":"Created
            by
            Administrator","footer_display_page_number":true,"content_type":"PDF","page_size":"A4","page_portrait":false},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reaseon":"For
            audit purposes"}');


            $request->setRequestUrl('https://{baseurl}/api/users/report');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'use_centigrade' => 'true',
              'adv' => 'mode1'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All
            Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created
            by
            Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For
            audit purposes\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created by Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For audit purposes\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1\"\n\n\tpayload := strings.NewReader(\"{\\\"View\\\":{\\\"Query\\\":{\\\"collection_name\\\":\\\"UserCollection\\\",\\\"object\\\":\\\"query\\\",\\\"orders\\\":[{\\\"column\\\":\\\"user_id\\\",\\\"descending\\\":\\\"false\\\"}]},\\\"display_fields\\\":[{\\\"name\\\":\\\"user_id\\\",\\\"display_name\\\":\\\"ID\\\",\\\"display_type\\\":\\\"string\\\",\\\"width\\\":5,\\\"enum\\\":[\\\"false=Active\\\",\\\"true=Inactive\\\"]}],\\\"name\\\":\\\"All Users\\\",\\\"show_title_every_page\\\":false,\\\"group_by_page_break\\\":false,\\\"footer_report_date\\\":true,\\\"footer_comment\\\":\\\"Created by Administrator\\\",\\\"footer_display_page_number\\\":true,\\\"content_type\\\":\\\"PDF\\\",\\\"page_size\\\":\\\"A4\\\",\\\"page_portrait\\\":false},\\\"adv_criteria\\\":{\\\"limit\\\":50,\\\"offset\\\":0,\\\"user_id\\\":\\\"11\\\",\\\"order_by\\\":\\\"user_id:false\\\",\\\"user_group_id\\\":1,\\\"user_group_ids\\\":[1121],\\\"user_name\\\":\\\"John\\\",\\\"user_email\\\":\\\"abc@gmail.com\\\",\\\"user_phone\\\":\\\"123-456-7890\\\",\\\"user_access_group_ids\\\":\\\"17,18\\\",\\\"user_operator_level_id\\\":0,\\\"user_department\\\":\\\"Engineering\\\",\\\"user_title\\\":\\\"Manager\\\",\\\"user_card\\\":\\\"123456\\\",\\\"user_custom_field_1\\\":\\\"string\\\",\\\"user_custom_field_2\\\":\\\"string\\\",\\\"user_custom_field_3\\\":\\\"string\\\",\\\"user_custom_field_4\\\":\\\"string\\\",\\\"user_custom_field_5\\\":\\\"string\\\",\\\"user_custom_field_6\\\":\\\"string\\\",\\\"user_custom_field_7\\\":\\\"string\\\",\\\"user_custom_field_8\\\":\\\"string\\\",\\\"user_custom_field_9\\\":\\\"string\\\",\\\"user_custom_field_10\\\":\\\"string\\\",\\\"user_status\\\":false},\\\"reaseon\\\":\\\"For audit purposes\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All
            Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created
            by
            Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For
            audit purposes\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"View": @{ @"Query": @{
            @"collection_name": @"UserCollection", @"object": @"query",
            @"orders": @[ @{ @"column": @"user_id", @"descending": @"false" } ]
            }, @"display_fields": @[ @{ @"name": @"user_id", @"display_name":
            @"ID", @"display_type": @"string", @"width": @5, @"enum": @[
            @"false=Active", @"true=Inactive" ] } ], @"name": @"All Users",
            @"show_title_every_page": @NO, @"group_by_page_break": @NO,
            @"footer_report_date": @YES, @"footer_comment": @"Created by
            Administrator", @"footer_display_page_number": @YES,
            @"content_type": @"PDF", @"page_size": @"A4", @"page_portrait": @NO
            },
                                          @"adv_criteria": @{ @"limit": @50, @"offset": @0, @"user_id": @"11", @"order_by": @"user_id:false", @"user_group_id": @1, @"user_group_ids": @[ @1121 ], @"user_name": @"John", @"user_email": @"abc@gmail.com", @"user_phone": @"123-456-7890", @"user_access_group_ids": @"17,18", @"user_operator_level_id": @0, @"user_department": @"Engineering", @"user_title": @"Manager", @"user_card": @"123456", @"user_custom_field_1": @"string", @"user_custom_field_2": @"string", @"user_custom_field_3": @"string", @"user_custom_field_4": @"string", @"user_custom_field_5": @"string", @"user_custom_field_6": @"string", @"user_custom_field_7": @"string", @"user_custom_field_8": @"string", @"user_custom_field_9": @"string", @"user_custom_field_10": @"string", @"user_status": @NO },
                                          @"reaseon": @"For audit purposes" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "View": [
                "Query": [
                  "collection_name": "UserCollection",
                  "object": "query",
                  "orders": [
                    [
                      "column": "user_id",
                      "descending": "false"
                    ]
                  ]
                ],
                "display_fields": [
                  [
                    "name": "user_id",
                    "display_name": "ID",
                    "display_type": "string",
                    "width": 5,
                    "enum": ["false=Active", "true=Inactive"]
                  ]
                ],
                "name": "All Users",
                "show_title_every_page": false,
                "group_by_page_break": false,
                "footer_report_date": true,
                "footer_comment": "Created by Administrator",
                "footer_display_page_number": true,
                "content_type": "PDF",
                "page_size": "A4",
                "page_portrait": false
              ],
              "adv_criteria": [
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [1121],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              ],
              "reaseon": "For audit purposes"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All
            Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created
            by
            Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For
            audit purposes\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created by Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For audit purposes\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"View":{"Query":{"collection_name":"UserCollection","object":"query","orders":[{"column":"user_id","descending":"false"}]},"display_fields":[{"name":"user_id","display_name":"ID","display_type":"string","width":5,"enum":["false=Active","true=Inactive"]}],"name":"All
            Users","show_title_every_page":false,"group_by_page_break":false,"footer_report_date":true,"footer_comment":"Created
            by
            Administrator","footer_display_page_number":true,"content_type":"PDF","page_size":"A4","page_portrait":false},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reaseon":"For
            audit purposes"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"View":{"Query":{"collection_name":"UserCollection","object":"query","orders":[{"column":"user_id","descending":"false"}]},"display_fields":[{"name":"user_id","display_name":"ID","display_type":"string","width":5,"enum":["false=Active","true=Inactive"]}],"name":"All
            Users","show_title_every_page":false,"group_by_page_break":false,"footer_report_date":true,"footer_comment":"Created
            by
            Administrator","footer_display_page_number":true,"content_type":"PDF","page_size":"A4","page_portrait":false},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false},"reaseon":"For
            audit purposes"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users/report"


            queryString <- list(
              use_centigrade = "true"
              adv = "mode1",
            )


            payload <-
            "{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All
            Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created
            by
            Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For
            audit purposes\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All
            Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created
            by
            Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For
            audit purposes\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"View\":{\"Query\":{\"collection_name\":\"UserCollection\",\"object\":\"query\",\"orders\":[{\"column\":\"user_id\",\"descending\":\"false\"}]},\"display_fields\":[{\"name\":\"user_id\",\"display_name\":\"ID\",\"display_type\":\"string\",\"width\":5,\"enum\":[\"false=Active\",\"true=Inactive\"]}],\"name\":\"All
            Users\",\"show_title_every_page\":false,\"group_by_page_break\":false,\"footer_report_date\":true,\"footer_comment\":\"Created
            by
            Administrator\",\"footer_display_page_number\":true,\"content_type\":\"PDF\",\"page_size\":\"A4\",\"page_portrait\":false},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false},\"reaseon\":\"For
            audit purposes\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users/report?use_centigrade=true&adv=mode1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/audit/search:
    post:
      tags:
        - Audit
      summary: Audit Search
      operationId: searchAuditSearch
      description: >-
        This API is used to view Audit Trail logs.


        It is possible to use multiple conditions in a request. Separate each
        condition using comma (,).


        Example:

        \[ {condition 1}, {condition 2}, .. \]
      requestBody:
        required: true
        description: Search criteria and pagination settings for audit trail logs
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuditSearchInput'
            example:
              Query:
                offset: 0
                limit: 5
                conditions:
                  - column: DATE
                    operator: 3
                    values:
                      - '2024-02-17T16:00:00.000Z'
                      - '2024-03-18T15:59:59.000Z'
                total: false
      responses:
        '200':
          description: Audit logs retrieved successfully
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/audit/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Query":{"offset":0,"limit":50,"total":false,"conditions":[{"column":"DATE","operator":3,"values":["2024-02-17T16:00:00.000Z","2024-03-18T15:59:59.000Z"]}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Query":{"offset":0,"limit":50,"total":false,"conditions":[{"column":"DATE","operator":3,"values":["2024-02-17T16:00:00.000Z","2024-03-18T15:59:59.000Z"]}]}}'
            |  \
              http POST https://{baseurl}/api/audit/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Query":{"offset":0,"limit":50,"total":false,"conditions":[{"column":"DATE","operator":3,"values":["2024-02-17T16:00:00.000Z","2024-03-18T15:59:59.000Z"]}]}}' \
              --output-document \
              - https://{baseurl}/api/audit/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/audit/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Query: {
                offset: 0,
                limit: 50,
                total: false,
                conditions: [
                  {
                    column: 'DATE',
                    operator: 3,
                    values: ['2024-02-17T16:00:00.000Z', '2024-03-18T15:59:59.000Z']
                  }
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Query: {
                  offset: 0,
                  limit: 50,
                  total: false,
                  conditions: [
                    {
                      column: 'DATE',
                      operator: 3,
                      values: ['2024-02-17T16:00:00.000Z', '2024-03-18T15:59:59.000Z']
                    }
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/audit/search");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Query": {
                "offset": 0,
                "limit": 50,
                "total": false,
                "conditions": [
                  {
                    "column": "DATE",
                    "operator": 3,
                    "values": [
                      "2024-02-17T16:00:00.000Z",
                      "2024-03-18T15:59:59.000Z"
                    ]
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Query: {
                  offset: 0,
                  limit: 50,
                  total: false,
                  conditions: [
                    {
                      column: 'DATE',
                      operator: 3,
                      values: ['2024-02-17T16:00:00.000Z', '2024-03-18T15:59:59.000Z']
                    }
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/audit/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"offset":0,"limit":50,"total":false,"conditions":[{"column":"DATE","operator":3,"values":["2024-02-17T16:00:00.000Z","2024-03-18T15:59:59.000Z"]}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"offset":0,"limit":50,"total":false,"conditions":[{"column":"DATE","operator":3,"values":["2024-02-17T16:00:00.000Z","2024-03-18T15:59:59.000Z"]}]}}'
            };

            fetch('https://{baseurl}/api/audit/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/audit/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Query": {
                "offset": 0,
                "limit": 50,
                "total": false,
                "conditions": [
                  {
                    "column": "DATE",
                    "operator": 3,
                    "values": [
                      "2024-02-17T16:00:00.000Z",
                      "2024-03-18T15:59:59.000Z"
                    ]
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/audit/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/audit/search", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/audit/search"


            payload = {"Query": {
                    "offset": 0,
                    "limit": 50,
                    "total": False,
                    "conditions": [
                        {
                            "column": "DATE",
                            "operator": 3,
                            "values": ["2024-02-17T16:00:00.000Z", "2024-03-18T15:59:59.000Z"]
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/audit/search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/audit/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/audit/search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Query":{"offset":0,"limit":50,"total":false,"conditions":[{"column":"DATE","operator":3,"values":["2024-02-17T16:00:00.000Z","2024-03-18T15:59:59.000Z"]}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Query":{"offset":0,"limit":50,"total":false,"conditions":[{"column":"DATE","operator":3,"values":["2024-02-17T16:00:00.000Z","2024-03-18T15:59:59.000Z"]}]}}');


            $request->setRequestUrl('https://{baseurl}/api/audit/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/audit/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/audit/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/audit/search\"\n\n\tpayload := strings.NewReader(\"{\\\"Query\\\":{\\\"offset\\\":0,\\\"limit\\\":50,\\\"total\\\":false,\\\"conditions\\\":[{\\\"column\\\":\\\"DATE\\\",\\\"operator\\\":3,\\\"values\\\":[\\\"2024-02-17T16:00:00.000Z\\\",\\\"2024-03-18T15:59:59.000Z\\\"]}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/audit/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Query": @{ @"offset": @0, @"limit":
            @50, @"total": @NO, @"conditions": @[ @{ @"column": @"DATE",
            @"operator": @3, @"values": @[ @"2024-02-17T16:00:00.000Z",
            @"2024-03-18T15:59:59.000Z" ] } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/audit/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Query": [
                "offset": 0,
                "limit": 50,
                "total": false,
                "conditions": [
                  [
                    "column": "DATE",
                    "operator": 3,
                    "values": ["2024-02-17T16:00:00.000Z", "2024-03-18T15:59:59.000Z"]
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/audit/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/audit/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/audit/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/audit/search' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Query":{"offset":0,"limit":50,"total":false,"conditions":[{"column":"DATE","operator":3,"values":["2024-02-17T16:00:00.000Z","2024-03-18T15:59:59.000Z"]}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/audit/search' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Query":{"offset":0,"limit":50,"total":false,"conditions":[{"column":"DATE","operator":3,"values":["2024-02-17T16:00:00.000Z","2024-03-18T15:59:59.000Z"]}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/audit/search"


            payload <-
            "{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/audit/search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Query\":{\"offset\":0,\"limit\":50,\"total\":false,\"conditions\":[{\"column\":\"DATE\",\"operator\":3,\"values\":[\"2024-02-17T16:00:00.000Z\",\"2024-03-18T15:59:59.000Z\"]}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/audit/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/users/phrase/{userId}:
    post:
      tags:
        - User
      summary: Create/Update User Private Message
      operationId: createUserPhrase
      description: |-
        This API is used to create or update User Private Message.

        This API is available starting from BioStar 2 version 2.9.8.
      requestBody:
        required: true
        description: Private message data to set for the user
        content:
          application/json:
            schema:
              type: object
              required:
                - phrase
              properties:
                phrase:
                  type: string
                  description: >-
                    Private message text to display to the user. Maximum 128
                    bytes - longer messages will be truncated.
                  maxLength: 128
                  minLength: 1
                  example: Good morning. Welcome to the office!
            example:
              phrase: Good morning. Set private message here.
      parameters:
        - name: userId
          in: path
          required: true
          description: User ID of the user to whom the private message will be configured.
          schema:
            type: integer
          example: 12
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/users/phrase/12 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"phrase":"Good morning. Welcome to the office!"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"phrase":"Good morning. Welcome to the office!"}' |  \
              http POST https://{baseurl}/api/v2/users/phrase/12 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"phrase":"Good morning. Welcome to the office!"}' \
              --output-document \
              - https://{baseurl}/api/v2/users/phrase/12
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/users/phrase/12",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({phrase: 'Good morning. Welcome to the
            office!'}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/users/phrase/12',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {phrase: 'Good morning. Welcome to the office!'},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/users/phrase/12");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "phrase": "Good morning. Welcome to the office!"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/users/phrase/12',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {phrase: 'Good morning. Welcome to the office!'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/users/phrase/12';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"phrase":"Good morning. Welcome to the office!"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"phrase":"Good morning. Welcome to the office!"}'
            };

            fetch('https://{baseurl}/api/v2/users/phrase/12', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/users/phrase/12",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"phrase\":\"Good morning. Welcome to the office!\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "phrase": "Good morning. Welcome to the office!"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/users/phrase/12");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"phrase\":\"Good morning. Welcome to the office!\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/users/phrase/12", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/users/phrase/12"


            payload = {"phrase": "Good morning. Welcome to the office!"}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/users/phrase/12")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"phrase\":\"Good morning. Welcome to the
            office!\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/users/phrase/12",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"phrase\":\"Good morning. Welcome to the office!\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/users/phrase/12');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"phrase":"Good morning. Welcome to the
            office!"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"phrase":"Good morning. Welcome to the office!"}');

            $request->setRequestUrl('https://{baseurl}/api/v2/users/phrase/12');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType, "{\"phrase\":\"Good
            morning. Welcome to the office!\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/users/phrase/12")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/users/phrase/12")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"phrase\":\"Good morning. Welcome to the office!\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/users/phrase/12\"\n\n\tpayload := strings.NewReader(\"{\\\"phrase\\\":\\\"Good morning. Welcome to the office!\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/users/phrase/12");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"phrase\":\"Good
            morning. Welcome to the office!\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"phrase": @"Good morning. Welcome to
            the office!" };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/users/phrase/12"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["phrase": "Good morning. Welcome to the office!"]
            as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/users/phrase/12")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/users/phrase/12");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json", "{\"phrase\":\"Good
            morning. Welcome to the office!\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/users/phrase/12"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"phrase\":\"Good morning. Welcome to the office!\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/users/phrase/12' -Method POST -Headers
            $headers -ContentType 'application/json' -Body '{"phrase":"Good
            morning. Welcome to the office!"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/users/phrase/12' -Method POST -Headers
            $headers -ContentType 'application/json' -Body '{"phrase":"Good
            morning. Welcome to the office!"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/users/phrase/12"


            payload <- "{\"phrase\":\"Good morning. Welcome to the office!\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/users/phrase/12"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string "{\"phrase\":\"Good morning.
            Welcome to the office!\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType, "{\"phrase\":\"Good
            morning. Welcome to the office!\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/users/phrase/12")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - User
      summary: Delete User Private Message
      operationId: deleteUserPhrase
      description: |-
        This API is used to delete User Private Message.

        This API is available starting from BioStar 2 version 2.9.8.
      parameters:
        - name: userId
          in: path
          schema:
            type: integer
          required: true
          description: User ID of the user to whom the private message will be deleted.
          example: 12
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url https://{baseurl}/api/v2/users/phrase/12 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE https://{baseurl}/api/v2/users/phrase/12 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/users/phrase/12
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/users/phrase/12",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/v2/users/phrase/12',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/v2/users/phrase/12");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/v2/users/phrase/12',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/users/phrase/12';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/users/phrase/12', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/users/phrase/12",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/v2/users/phrase/12");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/v2/users/phrase/12",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/users/phrase/12"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("DELETE", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/users/phrase/12")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/users/phrase/12",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/users/phrase/12');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/v2/users/phrase/12');
            $request->setRequestMethod('DELETE');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/users/phrase/12")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/v2/users/phrase/12")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/users/phrase/12\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/users/phrase/12");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/users/phrase/12"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/users/phrase/12")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/users/phrase/12");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/v2/users/phrase/12"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/users/phrase/12' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/users/phrase/12' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/users/phrase/12"


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/users/phrase/12"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/users/phrase/12")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - User
      summary: Fetch User Private Message
      operationId: getUserPhrase
      description: |-
        This API is used to fetch User Private Message.

        This API is available starting from BioStar 2 version 2.9.8.
      parameters:
        - name: userId
          in: path
          schema:
            type: integer
          required: true
          description: User ID of the user to whom the private message will be fetched.
          example: 12
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  user_id:
                    type: integer
                    description: User ID of the user
                    example: 12
                  phrase:
                    type: string
                    description: Private message text set for the user
                    example: Good morning. You're expected at meeting room 1 at 09.00
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/users/phrase/12 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/users/phrase/12 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/users/phrase/12
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/users/phrase/12",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/users/phrase/12',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/users/phrase/12");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/users/phrase/12',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/users/phrase/12';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/users/phrase/12', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/users/phrase/12",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/v2/users/phrase/12");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/users/phrase/12",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/users/phrase/12"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/users/phrase/12")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/users/phrase/12",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/users/phrase/12');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/v2/users/phrase/12');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/users/phrase/12")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/users/phrase/12")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/users/phrase/12\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/users/phrase/12");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/users/phrase/12"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/users/phrase/12")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/users/phrase/12");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/users/phrase/12"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/users/phrase/12' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/users/phrase/12' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/users/phrase/12"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/users/phrase/12"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/users/phrase/12")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/user_document/{UserID}/{customFieldID}:
    get:
      tags:
        - User
      summary: Download File from File Upload Custom Field
      operationId: getUserDocument
      description: >-
        This API is used to download the file which contained in a File Upload
        Custom Field.


        This API is available starting from BioStar 2 v2.9.8.


        After receiving the response, convert the Base64 data on key `document`
        to file type specified on key `mimetype`.
      parameters:
        - name: UserID
          in: path
          schema:
            type: integer
          required: true
          description: ID of the user which have the intended file.
          example: 3
        - name: customFieldID
          in: path
          schema:
            type: integer
          required: true
          description: ID of the File Upload Custom Field which contain the file.
          example: 5
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  Data:
                    type: object
                    properties:
                      document:
                        type: string
                        format: byte
                        description: Base64 encoded file data
                        example: U1c1IGlzIHRoZSBiZXN0IGRldmVsb3Blcg==
                      mimetype:
                        type: string
                        description: MIME type of the file
                        example: text/plain
                      item:
                        type: string
                        description: Original filename
                        example: ACCOUNTS.TXT
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/user_document/3/5 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/user_document/3/5 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/user_document/3/5
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/user_document/3/5",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/user_document/3/5',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/user_document/3/5");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/user_document/3/5',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/user_document/3/5';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/user_document/3/5', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/user_document/3/5",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/user_document/3/5");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/user_document/3/5",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/user_document/3/5"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/user_document/3/5")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/user_document/3/5",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/user_document/3/5');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/user_document/3/5');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/user_document/3/5")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/user_document/3/5")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/user_document/3/5\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/user_document/3/5");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/user_document/3/5"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/user_document/3/5")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/user_document/3/5");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/user_document/3/5"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/user_document/3/5' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/user_document/3/5' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/user_document/3/5"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/user_document/3/5" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/user_document/3/5")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/user/filter/user_and_group:
    get:
      tags:
        - User
      summary: View User & Group
      operationId: getUserFilterUserAndGroup
      description: >-
        Retrieves a combined list of **user groups** and **users**, including
        hierarchical relationships between groups and their members.  
          
        This endpoint is typically used to build a **tree structure** (group →
        subgroup → user) for user management, filtering, or selection
        interfaces.
      responses:
        '200':
          description: OK
          headers:
            transfer-encoding:
              schema:
                type: string
                example: chunked
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            X-XSS-Protection:
              schema:
                type: integer
                example: 1
            Cache-Control:
              schema:
                type: string
                example: no-cache, no-store, max-age=0, must-revalidate
            Pragma:
              schema:
                type: string
                example: no-cache
            Expires:
              schema:
                type: integer
                example: 0
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000 ; includeSubDomains
            X-Frame-Options:
              schema:
                type: string
                example: SAMEORIGIN
            Content-Security-Policy:
              schema:
                type: string
                example: >-
                  default-src 'self' *.biostar2.com:* localhost:* 127.0.0.1:*
                  blob: data: filesystem: mediastream:;script-src 'self'
                  https://*.biostar2.com https://cdn.jsdelivr.net
                  'unsafe-inline' 'unsafe-eval';style-src 'self'
                  https://*.biostar2.com 'unsafe-inline';worker-src 'self'
                  blob:;img-src 'self' blob: https://*.openstreetmap.org
                  data:;connect-src 'self' localhost:* 
                  https://*.openstreetmap.org;
            Content-Type:
              schema:
                type: string
                example: application/json;charset=UTF-8
            Date:
              schema:
                type: string
                example: Tue, 21 Oct 2025 07:12:06 GMT
            Referrer-Policy:
              schema:
                type: string
                example: no-referrer
          content:
            application/json:
              schema:
                type: object
              example:
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: success
                  by: web
                UserAndGroupCollection:
                  total: 10135
                  rows:
                    - id: userGroup-1
                      name: All
                      disabled: false
                      original_id: '1'
                      last_child: false
                    - id: userGroup-11241
                      name: Empty Users
                      disabled: true
                      original_id: '11241'
                      parent_id: userGroup-1
                      last_child: true
                    - id: userGroup-11024
                      name: Kumahira
                      disabled: false
                      original_id: '11024'
                      parent_id: userGroup-1
                      last_child: false
                    - id: user-9932
                      name: asdfsdfdsfa
                      disabled: false
                      original_id: '9932'
                      parent_id: userGroup-11024
                      parent_name: Kumahira
                      user_group: Kumahira
                      last_child: true
                    - id: user-9937
                      name: bobby
                      disabled: false
                      original_id: '9937'
                      parent_id: userGroup-11024
                      parent_name: Kumahira
                      user_group: Kumahira
                      last_child: true
                    - id: user-9938
                      name: Hildegaard
                      disabled: false
                      original_id: '9938'
                      parent_id: userGroup-11024
                      parent_name: Kumahira
                      user_group: Kumahira
                      last_child: true
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/user/filter/user_and_group \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/user/filter/user_and_group \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/user/filter/user_and_group
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/user/filter/user_and_group",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/user/filter/user_and_group',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/user/filter/user_and_group");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/user/filter/user_and_group',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/user/filter/user_and_group';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/user/filter/user_and_group',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/user/filter/user_and_group",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/user/filter/user_and_group");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/user/filter/user_and_group",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/user/filter/user_and_group"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/user/filter/user_and_group")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/user/filter/user_and_group",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/user/filter/user_and_group');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/user/filter/user_and_group');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/user/filter/user_and_group")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/user/filter/user_and_group")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/user/filter/user_and_group\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/user/filter/user_and_group");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/user/filter/user_and_group"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/user/filter/user_and_group")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/user/filter/user_and_group");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/user/filter/user_and_group"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/user/filter/user_and_group' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/user/filter/user_and_group' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/user/filter/user_and_group"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/user/filter/user_and_group" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/user/filter/user_and_group")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/device_groups/search:
    post:
      tags:
        - Device Group
      summary: View All Device Group
      operationId: searchDeviceGroupsearch
      description: >-
        This API is used to list all device groups recorded on BioStar X
        database.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                order_by: depth:false
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/device_groups/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"order_by":"depth:false"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"order_by":"depth:false"}' |  \
              http POST https://{baseurl}/api/v2/device_groups/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"order_by":"depth:false"}' \
              --output-document \
              - https://{baseurl}/api/v2/device_groups/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/device_groups/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({order_by: 'depth:false'}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/device_groups/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {order_by: 'depth:false'},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/device_groups/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "order_by": "depth:false"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/device_groups/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {order_by: 'depth:false'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/device_groups/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"order_by":"depth:false"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"order_by":"depth:false"}'
            };

            fetch('https://{baseurl}/api/v2/device_groups/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/device_groups/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"order_by\":\"depth:false\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "order_by": "depth:false"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/device_groups/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"order_by\":\"depth:false\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/device_groups/search",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/device_groups/search"


            payload = {"order_by": "depth:false"}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/device_groups/search")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"order_by\":\"depth:false\"}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/device_groups/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"order_by\":\"depth:false\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/device_groups/search');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"order_by":"depth:false"}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"order_by":"depth:false"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/device_groups/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"order_by\":\"depth:false\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/device_groups/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/device_groups/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"order_by\":\"depth:false\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/device_groups/search\"\n\n\tpayload := strings.NewReader(\"{\\\"order_by\\\":\\\"depth:false\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/device_groups/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"order_by\":\"depth:false\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"order_by": @"depth:false" };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/device_groups/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["order_by": "depth:false"] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/device_groups/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/device_groups/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"order_by\":\"depth:false\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/device_groups/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"order_by\":\"depth:false\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/device_groups/search' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"order_by":"depth:false"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/device_groups/search' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"order_by":"depth:false"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/device_groups/search"


            payload <- "{\"order_by\":\"depth:false\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/device_groups/search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"order_by\":\"depth:false\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"order_by\":\"depth:false\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/device_groups/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/device_groups/only_permission_item/search:
    post:
      tags:
        - Device Group
      summary: View Device Group(s) with Criteria & Permission
      operationId: searchDeviceGrouponlyPermissionItemsearch
      description: >-
        This API is used to list all device groups recorded on BioStar 2
        database.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                order_by: depth:false
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/device_groups/only_permission_item/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"order_by":"depth:false"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"order_by":"depth:false"}' |  \
              http POST https://{baseurl}/api/v2/device_groups/only_permission_item/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"order_by":"depth:false"}' \
              --output-document \
              - https://{baseurl}/api/v2/device_groups/only_permission_item/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/device_groups/only_permission_item/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({order_by: 'depth:false'}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/device_groups/only_permission_item/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {order_by: 'depth:false'},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/device_groups/only_permission_item/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "order_by": "depth:false"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/device_groups/only_permission_item/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {order_by: 'depth:false'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/device_groups/only_permission_item/search';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"order_by":"depth:false"}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"order_by":"depth:false"}'
            };


            fetch('https://{baseurl}/api/v2/device_groups/only_permission_item/search',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/device_groups/only_permission_item/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"order_by\":\"depth:false\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "order_by": "depth:false"
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/v2/device_groups/only_permission_item/search");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"order_by\":\"depth:false\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/v2/device_groups/only_permission_item/search",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url =
            "https://{baseurl}/api/v2/device_groups/only_permission_item/search"


            payload = {"order_by": "depth:false"}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/device_groups/only_permission_item/search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"order_by\":\"depth:false\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/device_groups/only_permission_item/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"order_by\":\"depth:false\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/device_groups/only_permission_item/search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"order_by":"depth:false"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"order_by":"depth:false"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/device_groups/only_permission_item/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"order_by\":\"depth:false\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/device_groups/only_permission_item/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/device_groups/only_permission_item/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"order_by\":\"depth:false\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/device_groups/only_permission_item/search\"\n\n\tpayload := strings.NewReader(\"{\\\"order_by\\\":\\\"depth:false\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/device_groups/only_permission_item/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"order_by\":\"depth:false\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"order_by": @"depth:false" };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/device_groups/only_permission_item/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["order_by": "depth:false"] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/device_groups/only_permission_item/search")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/device_groups/only_permission_item/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"order_by\":\"depth:false\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/device_groups/only_permission_item/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"order_by\":\"depth:false\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/device_groups/only_permission_item/search'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"order_by":"depth:false"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/device_groups/only_permission_item/search'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"order_by":"depth:false"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <-
            "https://{baseurl}/api/v2/device_groups/only_permission_item/search"


            payload <- "{\"order_by\":\"depth:false\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/device_groups/only_permission_item/search"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"order_by\":\"depth:false\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"order_by\":\"depth:false\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/device_groups/only_permission_item/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/device_groups:
    post:
      tags:
        - Device Group
      summary: Create New Device Group
      operationId: createDeviceGroup
      description: This API is used to create new device group.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DeviceGroup:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Name of the device group
                      example: New Device Group 1
                    description:
                      type: string
                      description: Description of the device group
                      example: Description of the device group
                    parent_id:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: ID of the parent group of this device group
                          example: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/device_groups \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DeviceGroup":{"name":"New Device Group 1","description":"Description of the device group","parent_id":{"id":1}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"DeviceGroup":{"name":"New Device Group
            1","description":"Description of the device
            group","parent_id":{"id":1}}}' |  \
              http POST https://{baseurl}/api/device_groups \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DeviceGroup":{"name":"New Device Group 1","description":"Description of the device group","parent_id":{"id":1}}}' \
              --output-document \
              - https://{baseurl}/api/device_groups
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/device_groups",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              DeviceGroup: {
                name: 'New Device Group 1',
                description: 'Description of the device group',
                parent_id: {id: 1}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/device_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                DeviceGroup: {
                  name: 'New Device Group 1',
                  description: 'Description of the device group',
                  parent_id: {id: 1}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/device_groups");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DeviceGroup": {
                "name": "New Device Group 1",
                "description": "Description of the device group",
                "parent_id": {
                  "id": 1
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/device_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                DeviceGroup: {
                  name: 'New Device Group 1',
                  description: 'Description of the device group',
                  parent_id: {id: 1}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/device_groups';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceGroup":{"name":"New Device Group 1","description":"Description of the device group","parent_id":{"id":1}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceGroup":{"name":"New Device Group 1","description":"Description of the device group","parent_id":{"id":1}}}'
            };

            fetch('https://{baseurl}/api/device_groups', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/device_groups",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DeviceGroup\":{\"name\":\"New Device Group 1\",\"description\":\"Description of the device group\",\"parent_id\":{\"id\":1}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DeviceGroup": {
                "name": "New Device Group 1",
                "description": "Description of the device group",
                "parent_id": {
                  "id": 1
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/device_groups");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"DeviceGroup\":{\"name\":\"New Device Group
            1\",\"description\":\"Description of the device
            group\",\"parent_id\":{\"id\":1}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/device_groups", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/device_groups"


            payload = {"DeviceGroup": {
                    "name": "New Device Group 1",
                    "description": "Description of the device group",
                    "parent_id": {"id": 1}
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/device_groups")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"DeviceGroup\":{\"name\":\"New Device Group
            1\",\"description\":\"Description of the device
            group\",\"parent_id\":{\"id\":1}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/device_groups",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DeviceGroup\":{\"name\":\"New Device Group 1\",\"description\":\"Description of the device group\",\"parent_id\":{\"id\":1}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/device_groups');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"DeviceGroup":{"name":"New Device Group
            1","description":"Description of the device
            group","parent_id":{"id":1}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"DeviceGroup":{"name":"New Device Group
            1","description":"Description of the device
            group","parent_id":{"id":1}}}');


            $request->setRequestUrl('https://{baseurl}/api/device_groups');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DeviceGroup\":{\"name\":\"New Device Group
            1\",\"description\":\"Description of the device
            group\",\"parent_id\":{\"id\":1}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/device_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/device_groups")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DeviceGroup\":{\"name\":\"New Device Group 1\",\"description\":\"Description of the device group\",\"parent_id\":{\"id\":1}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/device_groups\"\n\n\tpayload := strings.NewReader(\"{\\\"DeviceGroup\\\":{\\\"name\\\":\\\"New Device Group 1\\\",\\\"description\\\":\\\"Description of the device group\\\",\\\"parent_id\\\":{\\\"id\\\":1}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/device_groups");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DeviceGroup\":{\"name\":\"New Device Group
            1\",\"description\":\"Description of the device
            group\",\"parent_id\":{\"id\":1}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DeviceGroup": @{ @"name": @"New
            Device Group 1", @"description": @"Description of the device group",
            @"parent_id": @{ @"id": @1 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/device_groups"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DeviceGroup": [
                "name": "New Device Group 1",
                "description": "Description of the device group",
                "parent_id": ["id": 1]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/device_groups")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/device_groups");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DeviceGroup\":{\"name\":\"New Device Group
            1\",\"description\":\"Description of the device
            group\",\"parent_id\":{\"id\":1}}}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/device_groups"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DeviceGroup\":{\"name\":\"New Device Group 1\",\"description\":\"Description of the device group\",\"parent_id\":{\"id\":1}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/device_groups' -Method POST -Headers $headers
            -ContentType 'application/json' -Body '{"DeviceGroup":{"name":"New
            Device Group 1","description":"Description of the device
            group","parent_id":{"id":1}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/device_groups' -Method POST -Headers $headers
            -ContentType 'application/json' -Body '{"DeviceGroup":{"name":"New
            Device Group 1","description":"Description of the device
            group","parent_id":{"id":1}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/device_groups"


            payload <- "{\"DeviceGroup\":{\"name\":\"New Device Group
            1\",\"description\":\"Description of the device
            group\",\"parent_id\":{\"id\":1}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/device_groups" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DeviceGroup\":{\"name\":\"New Device Group
            1\",\"description\":\"Description of the device
            group\",\"parent_id\":{\"id\":1}}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DeviceGroup\":{\"name\":\"New Device Group
            1\",\"description\":\"Description of the device
            group\",\"parent_id\":{\"id\":1}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/device_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/device_groups/{id}:
    put:
      tags:
        - Device Group
      summary: Update Device Group
      operationId: updateDeviceGroup
      description: This API is used to update a device group.
      requestBody:
        content: {}
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device group which will be updated
          example: 5
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/device_groups/5 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http PUT https://{baseurl}/api/device_groups/5 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/device_groups/5
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/device_groups/5",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/device_groups/5',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/device_groups/5");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/device_groups/5',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/device_groups/5';


            let options = {method: 'PUT', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'PUT', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/device_groups/5', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/device_groups/5",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/device_groups/5");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("PUT", "{baseurl}/api/device_groups/5",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/device_groups/5"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("PUT", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/device_groups/5")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Put.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/device_groups/5",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/device_groups/5');
            $request->setMethod(HTTP_METH_PUT);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/device_groups/5');
            $request->setRequestMethod('PUT');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/device_groups/5")
              .put(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/device_groups/5")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/device_groups/5\"\n\n\treq, _ := http.NewRequest(\"PUT\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/device_groups/5");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/device_groups/5"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/device_groups/5")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/device_groups/5");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/device_groups/5"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/device_groups/5' -Method PUT -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/device_groups/5' -Method PUT -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/device_groups/5"


            response <- VERB("PUT", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/device_groups/5" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/device_groups/5")
              .put(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Device Group
      summary: Delete Device Group
      operationId: deleteDeviceGroup
      description: This API is used to delete device group.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device group which will be deleted
          example: 5
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url https://{baseurl}/api/device_groups/5 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE https://{baseurl}/api/device_groups/5 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/device_groups/5
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/device_groups/5",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/device_groups/5',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/device_groups/5");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/device_groups/5',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/device_groups/5';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/device_groups/5', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/device_groups/5",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/device_groups/5");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/device_groups/5",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/device_groups/5"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("DELETE", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/device_groups/5")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/device_groups/5",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/device_groups/5');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/device_groups/5');
            $request->setRequestMethod('DELETE');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/device_groups/5")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/device_groups/5")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/device_groups/5\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/device_groups/5");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/device_groups/5"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/device_groups/5")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/device_groups/5");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/device_groups/5"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/device_groups/5' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/device_groups/5' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/device_groups/5"


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/device_groups/5" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/device_groups/5")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{dev_id}/verify_fingerprint:
    post:
      tags:
        - Device
      summary: Verify Fingerprint Scan
      operationId: createDeviceVerifyFingerprint
      description: >-
        This API is used to compare 2 fingerprint scan to determine whether it's
        the same finger or not.


        As shown on the example, it is applied on `template0` and `template1`
        where `template0` is the 1st scan of the finger and `template1` is the
        2nd scan.


        To get the value for these parameters, use `POST
        /api/devices/:dev_id/scan_fingerprint` two times. The first scan for
        `template0` and second scan for `template1`.


        It will return HTTP 200 and shows message result: true on success, HTTP
        500 and shows message result: false on failure.
      requestBody:
        required: true
        description: Fingerprint templates and verification options
        content:
          application/json:
            schema:
              type: object
              required:
                - FingerprintTemplate
              properties:
                FingerprintTemplate:
                  type: object
                  description: Container for the two fingerprint templates to compare
                  required:
                    - template0
                    - template1
                  properties:
                    template0:
                      type: string
                      description: >-
                        Base64-encoded first fingerprint scan template
                        (reference template)
                      example: >-
                        RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///
                    template1:
                      type: string
                      description: >-
                        Base64-encoded second fingerprint scan template
                        (comparison template)
                      example: >-
                        RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=
                VerifyFingerprintOption:
                  type: object
                  description: Optional verification configuration
                  properties:
                    security_level:
                      type: string
                      description: >-
                        Security level for fingerprint verification. Higher
                        values require stricter matching.
                      enum:
                        - '0'
                        - '1'
                        - '2'
                        - '3'
                        - '4'
                        - '5'
                      default: '0'
                      example: '0'
      parameters:
        - name: dev_id
          in: path
          required: true
          description: Unique identifier of the device to perform fingerprint verification
          schema:
            type: integer
            minimum: 1
          example: 544140034
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/544140034/verify_fingerprint \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"FingerprintTemplate":{"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="},"VerifyFingerprintOption":{"security_level":"0"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"FingerprintTemplate":{"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="},"VerifyFingerprintOption":{"security_level":"0"}}'
            |  \
              http POST https://{baseurl}/api/devices/544140034/verify_fingerprint \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"FingerprintTemplate":{"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="},"VerifyFingerprintOption":{"security_level":"0"}}' \
              --output-document \
              - https://{baseurl}/api/devices/544140034/verify_fingerprint
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/544140034/verify_fingerprint",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              FingerprintTemplate: {
                template0: 'RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///',
                template1: 'RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8='
              },
              VerifyFingerprintOption: {security_level: '0'}
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/544140034/verify_fingerprint',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                FingerprintTemplate: {
                  template0: 'RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///',
                  template1: 'RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8='
                },
                VerifyFingerprintOption: {security_level: '0'}
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/544140034/verify_fingerprint");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "FingerprintTemplate": {
                "template0": "RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///",
                "template1": "RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="
              },
              "VerifyFingerprintOption": {
                "security_level": "0"
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/544140034/verify_fingerprint',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                FingerprintTemplate: {
                  template0: 'RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///',
                  template1: 'RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8='
                },
                VerifyFingerprintOption: {security_level: '0'}
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/devices/544140034/verify_fingerprint';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"FingerprintTemplate":{"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="},"VerifyFingerprintOption":{"security_level":"0"}}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"FingerprintTemplate":{"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="},"VerifyFingerprintOption":{"security_level":"0"}}'
            };


            fetch('https://{baseurl}/api/devices/544140034/verify_fingerprint',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/544140034/verify_fingerprint",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "FingerprintTemplate": {
                "template0": "RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///",
                "template1": "RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="
              },
              "VerifyFingerprintOption": {
                "security_level": "0"
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/devices/544140034/verify_fingerprint");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/devices/544140034/verify_fingerprint", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/544140034/verify_fingerprint"


            payload = {
                "FingerprintTemplate": {
                    "template0": "RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///",
                    "template1": "RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="
                },
                "VerifyFingerprintOption": {"security_level": "0"}
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/devices/544140034/verify_fingerprint")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/544140034/verify_fingerprint",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/544140034/verify_fingerprint');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"FingerprintTemplate":{"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="},"VerifyFingerprintOption":{"security_level":"0"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"FingerprintTemplate":{"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="},"VerifyFingerprintOption":{"security_level":"0"}}');


            $request->setRequestUrl('https://{baseurl}/api/devices/544140034/verify_fingerprint');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/544140034/verify_fingerprint")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/544140034/verify_fingerprint")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/544140034/verify_fingerprint\"\n\n\tpayload := strings.NewReader(\"{\\\"FingerprintTemplate\\\":{\\\"template0\\\":\\\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\\\",\\\"template1\\\":\\\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\\\"},\\\"VerifyFingerprintOption\\\":{\\\"security_level\\\":\\\"0\\\"}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/544140034/verify_fingerprint");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"FingerprintTemplate": @{
            @"template0":
            @"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///",
            @"template1":
            @"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="
            },
                                          @"VerifyFingerprintOption": @{ @"security_level": @"0" } };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/544140034/verify_fingerprint"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "FingerprintTemplate": [
                "template0": "RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///",
                "template1": "RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="
              ],
              "VerifyFingerprintOption": ["security_level": "0"]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/544140034/verify_fingerprint")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/544140034/verify_fingerprint");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/544140034/verify_fingerprint"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/544140034/verify_fingerprint' -Method
            POST -Headers $headers -ContentType 'application/json' -Body
            '{"FingerprintTemplate":{"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="},"VerifyFingerprintOption":{"security_level":"0"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/544140034/verify_fingerprint' -Method
            POST -Headers $headers -ContentType 'application/json' -Body
            '{"FingerprintTemplate":{"template0":"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///","template1":"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8="},"VerifyFingerprintOption":{"security_level":"0"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/544140034/verify_fingerprint"


            payload <-
            "{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/544140034/verify_fingerprint" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"FingerprintTemplate\":{\"template0\":\"RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///\",\"template1\":\"RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvdfsagfsgagOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=\"},\"VerifyFingerprintOption\":{\"security_level\":\"0\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/544140034/verify_fingerprint")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/server_matching/identify_finger:
    post:
      tags:
        - Device
      summary: Verify Duplicate Fingerprint
      operationId: createServerMatchingidentifyFinger
      description: >-
        This API is used to verify duplicate fingerprint.


        If fingerprint already exist, it will return success (HTTP 200) and
        response will show the user which currently using the fingerprint.


        Use the result of `POST /api/devices/:dev_id/scan_fingerprint` for the
        value of parameter template (either the 1st or 2nd scan).


        If fingerprint available, it will return server error (HTTP 500) with
        response showing message "Failed to identify fingerprint.".
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - ServerMatching
              properties:
                ServerMatching:
                  type: object
                  required:
                    - template
                  properties:
                    template:
                      type: string
                      description: Base64-encoded fingerprint template to identify
                      example: >-
                        AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/server_matching/identify_finger \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ServerMatching":{"template":"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"ServerMatching":{"template":"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"}}'
            |  \
              http POST https://{baseurl}/api/server_matching/identify_finger \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ServerMatching":{"template":"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"}}' \
              --output-document \
              - https://{baseurl}/api/server_matching/identify_finger
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/server_matching/identify_finger",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              ServerMatching: {
                template: 'AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw'
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/server_matching/identify_finger',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                ServerMatching: {
                  template: 'AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw'
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/server_matching/identify_finger");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "ServerMatching": {
                "template": "AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/server_matching/identify_finger',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                ServerMatching: {
                  template: 'AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw'
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/server_matching/identify_finger';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ServerMatching":{"template":"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ServerMatching":{"template":"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"}}'
            };


            fetch('https://{baseurl}/api/server_matching/identify_finger',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/server_matching/identify_finger",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "ServerMatching": {
                "template": "AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/server_matching/identify_finger");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/server_matching/identify_finger", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/server_matching/identify_finger"


            payload = {"ServerMatching": {"template":
            "AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/server_matching/identify_finger")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/server_matching/identify_finger",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/server_matching/identify_finger');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"ServerMatching":{"template":"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ServerMatching":{"template":"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"}}');


            $request->setRequestUrl('https://{baseurl}/api/server_matching/identify_finger');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/server_matching/identify_finger")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/server_matching/identify_finger")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/server_matching/identify_finger\"\n\n\tpayload := strings.NewReader(\"{\\\"ServerMatching\\\":{\\\"template\\\":\\\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\\\"}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/server_matching/identify_finger");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ServerMatching": @{ @"template":
            @"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"
            } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/server_matching/identify_finger"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ServerMatching": ["template":
            "AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"]]
            as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/server_matching/identify_finger")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/server_matching/identify_finger");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/server_matching/identify_finger"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/server_matching/identify_finger' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"ServerMatching":{"template":"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/server_matching/identify_finger' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"ServerMatching":{"template":"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/server_matching/identify_finger"


            payload <-
            "{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/server_matching/identify_finger" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"ServerMatching\":{\"template\":\"AA4NE6cAVUYXwGEODRaBgWmJGoLhCoUTw+BohB0EYWaJIMKAWIkiAsAJijED4K6JJ8ehAwkwCFCyhCYIoFcLLQjRVoQeyTFligMJUG2GD0vxcQYezkFpjAIO4HWbFU9RcwUgD4Fnkx9QsWwPCpDhcgkfkZFoiydJwAMJJQrRXAknDABTCCsP4aCJJhBABJ4m0PGqoSqRYKkXKRIQCJ7//93v//////3d7/////zN3uAP//zM3e4AH8zMzN7gAfzMzM3uARK8zM3e4AEbvMzd7gARu8zM3uARHMzMze4BEczMzN3gESu7vMzeARK7u8zN4BI7u7vM3gIjqru7vOAzT6u7u84TRP+7zMzRNE//zMzN4jP//8zM3hLw\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/server_matching/identify_finger")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/waiting:
    get:
      tags:
        - Device
      summary: View Waiting Devices
      operationId: getDeviceWaiting
      description: >-
        This API is used to view device(s) which is on waiting list after
        changing connection mode from **Server** > **Device to Device** > 
        **Server**.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/devices/waiting \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/devices/waiting \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices/waiting
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/waiting",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/waiting',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/devices/waiting");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/waiting',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices/waiting';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/waiting', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/waiting",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/devices/waiting");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/devices/waiting",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices/waiting"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/waiting")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/waiting",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/devices/waiting');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/devices/waiting');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/waiting")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/devices/waiting")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/waiting\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/waiting");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/waiting"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/waiting")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/waiting");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/devices/waiting"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/waiting' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/waiting' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/waiting"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices/waiting" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/waiting")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices:
    post:
      tags:
        - Device
      summary: Add Slave Device
      operationId: createDevice
      description: This example shows how to add slave device to BioStar X.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DeviceCollection:
                  type: object
                  properties:
                    rows:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            description: ID of the device
                            example: '40059024'
                          name:
                            type: string
                            description: Name of the device
                            example: BioStation 3 40059024
                          device_type_id:
                            type: object
                            properties:
                              id:
                                type: integer
                                description: Device Type ID of the device
                                example: 35
                          parent_device_id:
                            type: object
                            properties:
                              id:
                                type: integer
                                description: ID of the parent device
                                example: 40059023
                          rs485:
                            type: object
                            properties:
                              mode:
                                type: string
                                description: RS485 Mode
                                example: '2'
                              connected_channel_index:
                                type: string
                                description: Connected Channel Index
                                example: '0'
                              parent_rs485_info:
                                type: string
                                description: Parent RS485 Info
                                example: RS485 Port 0
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DeviceCollection":{"rows":[{"id":"40059024","name":"BioStation 3 40059024","device_type_id":{"id":35},"parent_device_id":{"id":40059023},"rs485":{"mode":"2","connected_channel_index":"0","parent_rs485_info":"RS485 Port 0"}}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"DeviceCollection":{"rows":[{"id":"40059024","name":"BioStation 3
            40059024","device_type_id":{"id":35},"parent_device_id":{"id":40059023},"rs485":{"mode":"2","connected_channel_index":"0","parent_rs485_info":"RS485
            Port 0"}}]}}' |  \
              http POST https://{baseurl}/api/devices \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DeviceCollection":{"rows":[{"id":"40059024","name":"BioStation 3 40059024","device_type_id":{"id":35},"parent_device_id":{"id":40059023},"rs485":{"mode":"2","connected_channel_index":"0","parent_rs485_info":"RS485 Port 0"}}]}}' \
              --output-document \
              - https://{baseurl}/api/devices
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              DeviceCollection: {
                rows: [
                  {
                    id: '40059024',
                    name: 'BioStation 3 40059024',
                    device_type_id: {id: 35},
                    parent_device_id: {id: 40059023},
                    rs485: {mode: '2', connected_channel_index: '0', parent_rs485_info: 'RS485 Port 0'}
                  }
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                DeviceCollection: {
                  rows: [
                    {
                      id: '40059024',
                      name: 'BioStation 3 40059024',
                      device_type_id: {id: 35},
                      parent_device_id: {id: 40059023},
                      rs485: {mode: '2', connected_channel_index: '0', parent_rs485_info: 'RS485 Port 0'}
                    }
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/devices");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": "40059024",
                    "name": "BioStation 3 40059024",
                    "device_type_id": {
                      "id": 35
                    },
                    "parent_device_id": {
                      "id": 40059023
                    },
                    "rs485": {
                      "mode": "2",
                      "connected_channel_index": "0",
                      "parent_rs485_info": "RS485 Port 0"
                    }
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                DeviceCollection: {
                  rows: [
                    {
                      id: '40059024',
                      name: 'BioStation 3 40059024',
                      device_type_id: {id: 35},
                      parent_device_id: {id: 40059023},
                      rs485: {mode: '2', connected_channel_index: '0', parent_rs485_info: 'RS485 Port 0'}
                    }
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/devices';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":"40059024","name":"BioStation 3 40059024","device_type_id":{"id":35},"parent_device_id":{"id":40059023},"rs485":{"mode":"2","connected_channel_index":"0","parent_rs485_info":"RS485 Port 0"}}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":"40059024","name":"BioStation 3 40059024","device_type_id":{"id":35},"parent_device_id":{"id":40059023},"rs485":{"mode":"2","connected_channel_index":"0","parent_rs485_info":"RS485 Port 0"}}]}}'
            };

            fetch('https://{baseurl}/api/devices', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation 3 40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485 Port 0\"}}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": "40059024",
                    "name": "BioStation 3 40059024",
                    "device_type_id": {
                      "id": 35
                    },
                    "parent_device_id": {
                      "id": 40059023
                    },
                    "rs485": {
                      "mode": "2",
                      "connected_channel_index": "0",
                      "parent_rs485_info": "RS485 Port 0"
                    }
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/devices");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation
            3
            40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485
            Port 0\"}}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/devices", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices"


            payload = {"DeviceCollection": {"rows": [
                        {
                            "id": "40059024",
                            "name": "BioStation 3 40059024",
                            "device_type_id": {"id": 35},
                            "parent_device_id": {"id": 40059023},
                            "rs485": {
                                "mode": "2",
                                "connected_channel_index": "0",
                                "parent_rs485_info": "RS485 Port 0"
                            }
                        }
                    ]}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/devices")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation
            3
            40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485
            Port 0\"}}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation 3 40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485 Port 0\"}}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"DeviceCollection":{"rows":[{"id":"40059024","name":"BioStation
            3
            40059024","device_type_id":{"id":35},"parent_device_id":{"id":40059023},"rs485":{"mode":"2","connected_channel_index":"0","parent_rs485_info":"RS485
            Port 0"}}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"DeviceCollection":{"rows":[{"id":"40059024","name":"BioStation
            3
            40059024","device_type_id":{"id":35},"parent_device_id":{"id":40059023},"rs485":{"mode":"2","connected_channel_index":"0","parent_rs485_info":"RS485
            Port 0"}}]}}');


            $request->setRequestUrl('https://{baseurl}/api/devices');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation
            3
            40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485
            Port 0\"}}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation 3 40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485 Port 0\"}}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices\"\n\n\tpayload := strings.NewReader(\"{\\\"DeviceCollection\\\":{\\\"rows\\\":[{\\\"id\\\":\\\"40059024\\\",\\\"name\\\":\\\"BioStation 3 40059024\\\",\\\"device_type_id\\\":{\\\"id\\\":35},\\\"parent_device_id\\\":{\\\"id\\\":40059023},\\\"rs485\\\":{\\\"mode\\\":\\\"2\\\",\\\"connected_channel_index\\\":\\\"0\\\",\\\"parent_rs485_info\\\":\\\"RS485 Port 0\\\"}}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL, "https://{baseurl}/api/devices");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation
            3
            40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485
            Port 0\"}}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DeviceCollection": @{ @"rows": @[ @{
            @"id": @"40059024", @"name": @"BioStation 3 40059024",
            @"device_type_id": @{ @"id": @35 }, @"parent_device_id": @{ @"id":
            @40059023 }, @"rs485": @{ @"mode": @"2", @"connected_channel_index":
            @"0", @"parent_rs485_info": @"RS485 Port 0" } } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DeviceCollection": ["rows": [
                  [
                    "id": "40059024",
                    "name": "BioStation 3 40059024",
                    "device_type_id": ["id": 35],
                    "parent_device_id": ["id": 40059023],
                    "rs485": [
                      "mode": "2",
                      "connected_channel_index": "0",
                      "parent_rs485_info": "RS485 Port 0"
                    ]
                  ]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/devices");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation
            3
            40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485
            Port 0\"}}]}}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation 3 40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485 Port 0\"}}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/devices'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":"40059024","name":"BioStation 3
            40059024","device_type_id":{"id":35},"parent_device_id":{"id":40059023},"rs485":{"mode":"2","connected_channel_index":"0","parent_rs485_info":"RS485
            Port 0"}}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/devices'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":"40059024","name":"BioStation 3
            40059024","device_type_id":{"id":35},"parent_device_id":{"id":40059023},"rs485":{"mode":"2","connected_channel_index":"0","parent_rs485_info":"RS485
            Port 0"}}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices"


            payload <-
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation
            3
            40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485
            Port 0\"}}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation
            3
            40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485
            Port 0\"}}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":\"40059024\",\"name\":\"BioStation
            3
            40059024\",\"device_type_id\":{\"id\":35},\"parent_device_id\":{\"id\":40059023},\"rs485\":{\"mode\":\"2\",\"connected_channel_index\":\"0\",\"parent_rs485_info\":\"RS485
            Port 0\"}}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Device
      summary: List All Added Device(s)
      operationId: listDevice
      description: >-
        This API is used to view all devices added to BioStar X.


        **Status response for this API:**


        | **Parameter** | **Type** | **Description** |

        | --- | --- | --- |

        | status | Integer | Connection status of the device.  <br>0:
        Disconnected  <br>1: Connected  <br>2: Sync Error |
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/devices \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/devices \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/devices");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/devices");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/devices", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/devices');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/devices');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/devices")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL, "https://{baseurl}/api/devices");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/devices");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/devices"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/devices'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/devices'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Device
      summary: Remove Device(s)
      operationId: deleteDevice
      description: This API is used to delete device(s).
      parameters:
        - name: id
          in: query
          schema:
            type: integer
          description: >-
            ID of the device(s) which will be deleted. To delete multiple device
            use plus (+) sign as separator.
          example: 543408590
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/devices?id=543408590' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE 'https://{baseurl}/api/devices?id=543408590' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/devices?id=543408590'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices?id=543408590",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/devices',
              qs: {id: '543408590'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("DELETE", "https://{baseurl}/api/devices");

            req.query({
              "id": "543408590"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/devices',
              params: {id: '543408590'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices?id=543408590';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices?id=543408590', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices?id=543408590",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/devices?id=543408590");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/devices?id=543408590",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices"


            querystring = {"id":"543408590"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices?id=543408590")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices?id=543408590",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/devices');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => '543408590'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/devices');
            $request->setRequestMethod('DELETE');
            $request->setQuery(new http\QueryString([
              'id' => '543408590'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices?id=543408590")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/devices?id=543408590")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices?id=543408590\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices?id=543408590");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices?id=543408590"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices?id=543408590")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices?id=543408590");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/devices?id=543408590"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices?id=543408590' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices?id=543408590' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices"


            queryString <- list([ 'id' ] = "543408590")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices?id=543408590"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices?id=543408590")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{id}:
    put:
      tags:
        - Device
      summary: Update Device
      operationId: updateDevice
      description: >-
        This API is used to update device's configuration.  

        Put value which will be updated on the respective body parameter and
        remove any parameters which will not be updated.
      requestBody:
        required: true
        description: >-
          Device configuration data to update. Only include fields that need to
          be changed.
        content:
          application/json:
            schema:
              type: object
              description: Device configuration update payload
              properties:
                Device:
                  type: object
                  description: Container for all device configuration settings
                  properties:
                    name:
                      type: string
                      description: Display name of the device
                      example: FaceStation 2 542353521 (192.168.1.23)
                    device_group_id:
                      type: object
                      description: Group ID of the device
                      properties:
                        id:
                          type: integer
                          description: ID of the device group
                          example: 47
                        name:
                          type: string
                          description: Name of the device group
                          example: Suprema
                    lan:
                      type: object
                      description: LAN network configuration
                      properties:
                        connection_mode:
                          type: integer
                          description: >-
                            Connection mode (`0`=Server to Device, `1`=Device to
                            Server)
                          enum:
                            - 0
                            - 1
                          example: 1
                        enable_dhcp:
                          type: boolean
                          description: Toggle true to enable DHCP
                          example: false
                        use_dns:
                          type: boolean
                          description: Toggle true to use DNS
                          example: false
                        ip:
                          type: string
                          format: ipv4
                          description: Static IP address of the device
                          example: 192.168.1.23
                        device_port:
                          type: integer
                          description: Communication port used by device
                          example: 51211
                        gateway:
                          type: string
                          format: ipv4
                          description: IP gateway which the device use
                          example: 192.168.1.1
                        subnet_mask:
                          type: string
                          format: ipv4
                          description: Subnet of the device
                          example: 255.255.255.0
                        server_port:
                          type: integer
                          description: Connection port of the server
                          example: 51212
                        server_ip:
                          type: string
                          format: ipv4
                          description: IP of the server
                          example: 192.168.1.5
                    usb:
                      type: object
                      description: USB configuration settings
                      properties:
                        enable_usb:
                          type: boolean
                          description: Enable or disable USB functionality
                          example: false
                        enable_usb_memory:
                          type: boolean
                          description: Enable or disable USB memory access
                          example: false
                    wlan:
                      type: object
                      description: WLAN wireless network configuration
                      properties:
                        enabled:
                          type: boolean
                          description: Toggle true to use WLAN (only for supported devices)
                          example: false
                        operation_mode:
                          type: integer
                          description: Operation mode of the device
                          example: 0
                        auth_type:
                          type: integer
                          description: WLAN authorization type
                          example: 0
                        encryption_type:
                          type: integer
                          description: WLAN encryption type
                          example: 0
                    rs485:
                      type: object
                      description: RS485 serial communication configuration
                      properties:
                        mode:
                          type: integer
                          description: >-
                            RS485 mode setting (`1`=Master, `2`=Slave,
                            `3`=Default)
                          example: 3
                        intelligentInfo:
                          type: object
                          description: Intelligent RS485 configuration
                          properties:
                            supportIConfig:
                              type: boolean
                              description: Support iConfig protocol
                              example: false
                            useFailCode:
                              type: boolean
                              description: Use fail code feature
                              example: false
                            failCodeFormat:
                              type: integer
                              description: Format of the fail code
                              example: 1
                            failCode:
                              type: string
                              description: Fail code value
                              example: '0000000000000000'
                            osdpID:
                              type: integer
                              description: OSDP ID for the device
                              example: 0
                            cardFormat:
                              type: integer
                              description: Card format setting
                              example: 0
                        channels:
                          type: array
                          description: RS485 channel configurations
                          items:
                            type: object
                            properties:
                              index:
                                type: integer
                                description: Channel index
                                example: 0
                              mode:
                                type: integer
                                description: Channel usage (same as mode)
                                example: 1
                              baudrate:
                                type: integer
                                description: Baudrate value
                                example: 115200
                    authentication:
                      type: object
                      description: Authentication and biometric settings
                      properties:
                        matching_timeout:
                          type: string
                          description: Matching Timeout
                          example: '5'
                        auth_timeout:
                          type: string
                          description: Authentication Timeout
                          example: '5'
                        enable_private_auth:
                          type: boolean
                          description: Use Private Authentication
                          example: true
                        enable_server_matching:
                          type: boolean
                          description: Use Server Matching
                          example: false
                        face_detection_level:
                          type: string
                          description: Face Detection Level
                          example: '0'
                        enable_full_access:
                          type: boolean
                          description: Enable full access
                          example: false
                        operation_modes:
                          type: array
                          description: List of authentication operation modes
                          items:
                            type: object
                            properties:
                              mode:
                                type: integer
                                description: Operation/Authentication mode
                                example: 0
                              schedule_id:
                                type: object
                                description: Schedule ID for the mode
                                properties:
                                  id:
                                    type: integer
                                    description: >-
                                      Schedule applied for
                                      Operation/Authentication Mode
                                    example: 1
                              operators:
                                type: array
                                description: >-
                                  List of operator IDs allowed for private
                                  authentication
                                items:
                                  type: object
                                example: []
                              enable_card_Id_from_keypad:
                                type: boolean
                                description: Enable card ID input from keypad
                                example: false
                    card:
                      type: object
                      description: Card reader configuration and supported card types
                      properties:
                        use_csn:
                          type: boolean
                          description: Use CSN
                          example: true
                        use_mifare_felica:
                          type: boolean
                          description: Use Mifare Felica
                          example: true
                        use_em:
                          type: boolean
                          description: Use EM
                          example: true
                        use_wiegand:
                          type: boolean
                          description: Use Wiegand
                          example: false
                        use_iclass:
                          type: boolean
                          description: Use iClass
                          example: false
                        use_HIDprox:
                          type: boolean
                          description: Use HID Prox
                          example: false
                        use_smart:
                          type: boolean
                          description: Use Smart Card
                          example: true
                        use_SEOS:
                          type: boolean
                          description: Use SEOS
                          example: false
                        use_SR_SE:
                          type: boolean
                          description: Use SR SE
                          example: false
                        use_desfire_ev1:
                          type: boolean
                          description: Use Desfire EV1
                          example: true
                        use_classic_plus:
                          type: boolean
                          description: Use Classic Plus
                          example: true
                        use_mobile:
                          type: boolean
                          description: Use Mobile
                          example: true
                        use_BLE:
                          type: boolean
                          description: Use BLE
                          example: false
                        use_NFC:
                          type: boolean
                          description: Use NFC
                          example: true
                        byte_order:
                          type: string
                          description: Card data byte order
                          example: '0'
                        use_wiegand_format:
                          type: boolean
                          description: Use Wiegand format
                          example: false
                        card_layout:
                          type: object
                          description: Card layout configuration
                          properties:
                            id:
                              type: string
                              description: Card layout ID
                              example: '2'
                    display:
                      type: object
                      description: Display and user interface settings
                      properties:
                        language:
                          type: string
                          description: Device display language
                          example: '1'
                        background:
                          type: string
                          description: Background
                          example: '0'
                        background_theme:
                          type: string
                          description: Background theme
                          example: '1'
                        volume:
                          type: string
                          description: Audio volume level
                          example: '50'
                        use_voice:
                          type: boolean
                          description: Use voice prompts
                          example: false
                        menu_timeout:
                          type: string
                          description: Menu timeout
                          example: '20'
                        message_timeout:
                          type: string
                          description: Message timeout
                          example: '2000'
                        backlight_timeout:
                          type: string
                          description: Backlight timeout
                          example: '20'
                        display_datetime:
                          type: boolean
                          description: Display dateTime
                          example: true
                        date_type:
                          type: string
                          description: Date type
                          example: '0'
                        time_format:
                          type: string
                          description: Time format
                          example: '0'
                        home_formation:
                          type: string
                          description: Home formation
                          example: '5'
                        shortcut_home:
                          type: string
                          description: Shortcut home
                          example: ''
                        device_private_message:
                          type: boolean
                          description: Device private message
                          example: false
                        server_private_message:
                          type: boolean
                          description: Server private message
                          example: false
                        use_screen_saver:
                          type: boolean
                          description: Use screen saver
                          example: false
                        sounds:
                          type: array
                          description: List of sound settings
                          items:
                            type: object
                          example: []
                    system:
                      type: object
                      description: System-level configuration
                      properties:
                        timezone:
                          type: integer
                          description: Timezone
                          example: 28800
                        sync_time:
                          type: boolean
                          description: Sync time
                          example: true
                        locked:
                          type: boolean
                          description: Locked
                          example: false
                        interphone_type:
                          type: integer
                          description: Interphone type
                          example: 0
                        camera_frequency:
                          type: string
                          description: Camera frequency
                          example: '60'
                        use_alphanumeric:
                          type: boolean
                          description: Use alphanumeric
                          example: false
                        enable_clear_on_tamper:
                          type: boolean
                          description: User clear tamper
                          example: true
                        enable_data_encryption:
                          type: boolean
                          description: Use data encryption
                          example: false
                        use_card_operation:
                          type: boolean
                          description: Use card operation
                          example: true
                    wiegand:
                      type: object
                      description: Wiegand configuration
                      properties:
                        wiegand_in_out:
                          type: string
                          description: Wiegand In Out
                          example: '0'
                        out_pulse_width:
                          type: string
                          description: Out Pulse Width
                          example: '40'
                        out_pulse_interval:
                          type: string
                          description: Out Pulse Interval
                          example: '10000'
                        enable_bypass_mode:
                          type: boolean
                          description: Use Bypass Mode
                          example: false
                        format_id:
                          type: object
                          description: Wiegand Format ID
                          properties:
                            id:
                              type: string
                              description: Format ID
                              example: '0'
                        enable_fail_code:
                          type: boolean
                          description: Use Fail Code
                          example: false
                        fail_code:
                          type: string
                          description: Fail Code
                          example: '0'
                        wiegand_output_info:
                          type: string
                          description: Wiegand output information
                          example: '1'
                        wiegand_csn_id:
                          type: object
                          description: Wiegand CSN ID
                          properties:
                            id:
                              type: string
                              description: CSN ID
                              example: '-1'
                        wiegand_cards:
                          type: array
                          description: List of Wiegand cards
                          items:
                            type: object
                          example: []
                        wiegand_inputs:
                          type: array
                          description: List of Wiegand inputs
                          items:
                            type: object
                          example: []
                    tna:
                      type: object
                      description: Time and Attendance (T&A) configuration
                      properties:
                        mode:
                          type: string
                          description: T&A Mode
                          example: '1'
                        fixed_code:
                          type: integer
                          description: T&A Fixed Code
                          example: 0
                        required:
                          type: boolean
                          description: T&A Required
                          example: false
                        tna_keys:
                          type: array
                          description: List of T&A keys
                          items:
                            type: object
                            properties:
                              order:
                                type: integer
                                description: T&A keys order
                                example: 1
                              key:
                                type: integer
                                description: T&A Key
                                example: 0
                              keyName:
                                type: string
                                description: T&A Key name
                                example: Code 1
                              schedule_id:
                                type: object
                                description: Schedule ID
                                properties: {}
                                example: {}
                              label:
                                type: string
                                description: Key label
                                example: ''
                    input:
                      type: object
                      description: Input configuration
                      properties:
                        input_port_num:
                          type: string
                          description: Input Port Number
                          example: '0'
                        supervised_inputs:
                          type: string
                          description: Supervised inputs
                          example: ''
                    event_filter:
                      type: object
                      description: >-
                        List of event filters in which image logs are saved on
                        the device
                      properties:
                        rows:
                          type: array
                          description: Event filter configuration
                          items:
                            type: object
                          example: []
                        total:
                          type: string
                          description: Total number of event filters
                          example: '0'
                    voip:
                      type: object
                      description: VoIP configuration
                      properties:
                        use:
                          type: boolean
                          description: Use VoIP
                          example: false
                        server:
                          type: object
                          description: VoIP server settings
                          properties:
                            address:
                              type: string
                              description: Server address
                              example: ''
                            user_id:
                              type: string
                              description: User ID
                              example: ''
                            password:
                              type: string
                              description: Password
                              example: ''
                            port:
                              type: string
                              description: Port
                              example: ''
                        dtmf:
                          type: object
                          description: DTMF settings
                          properties:
                            mode:
                              type: string
                              description: DTMF mode
                              example: '0'
                            exit_button:
                              type: string
                              description: Exit button
                              example: '0'
                        phonebook_list:
                          type: array
                          description: List of extension numbers on the intercom
                          items:
                            type: object
                          example: []
                    barcode:
                      type: object
                      description: Barcode configuration
                      properties:
                        use_barcode:
                          type: boolean
                          description: Use Barcode
                          example: false
                        scan_timeout:
                          type: string
                          description: Scan timeout
                          example: '4'
                    pktversion:
                      type: string
                      description: Packet version
                      example: '3'
                    support_occupancy:
                      type: boolean
                      description: Support occupancy
                      example: true
                    thermal_config:
                      type: object
                      description: Thermal camera configuration for temperature screening
                      properties:
                        enable_thermal_camera:
                          type: string
                          description: >-
                            Thermal camera mode (`0`=Not Use, `1`=Deny access
                            when exceeded threshold temperature, `2`=Allow
                            access after leaving log when exceeded threshold
                            temperature
                          enum:
                            - '0'
                            - '1'
                            - '2'
                          example: '0'
                        enable_centigrade:
                          type: string
                          description: Celsius (1)
                          example: '1'
                        temperature_threshold_high:
                          type: string
                          description: Threshold Temperature (Celsius, 38.0 -> 3800)
                          example: '3800'
                        enable_audit_temperature:
                          type: boolean
                          description: Save temperature data
                          example: true
                        enable_temperature_reject_sound:
                          type: boolean
                          description: Temperature fail sound
                          example: true
                        enable_overlap_thermal:
                          type: boolean
                          description: Show Infrared Image (Device not supported)
                          example: true
                        temperature_checkmode:
                          type: string
                          description: >-
                            Temperature check mode (`0`=Check after
                            authentication, `1`=Check before authentication,
                            `2`=Check without authentication)
                          enum:
                            - '0'
                            - '1'
                            - '2'
                          example: '0'
                        enable_mask:
                          type: string
                          description: >-
                            Mask detection mode (`0`=Not Use, `1`=Deny access
                            when failed to detect mask, `2`=Allow access after
                            leaving log when failed to detect mask)
                          enum:
                            - '0'
                            - '1'
                            - '2'
                          example: '0'
                        mask_detection_level:
                          type: string
                          description: >-
                            Mask detection sensitivity level (`0`=Off,
                            `1`=Strict, `2`=More Strict, `3`=Most Strict)
                          enum:
                            - '0'
                            - '1'
                            - '2'
                            - '3'
                          example: '0'
                        enable_dynamic_roi:
                          type: boolean
                          description: Dynamic ROI (Device not supported)
                          example: false
                    thermal_camera_config:
                      type: object
                      description: Detailed thermal camera settings
                      properties:
                        distance:
                          type: string
                          description: Distance (cm)
                          example: '100'
                        emissivity:
                          type: string
                          description: Emission Rate (0.95 → 95, 0.97 → 97, 0.98 → 98)
                          example: '98'
                        roi_x:
                          type: string
                          description: ROI X (%)
                          example: '47'
                        roi_y:
                          type: string
                          description: ROI Y (%)
                          example: '45'
                        roi_width:
                          type: string
                          description: ROI width (%)
                          example: '15'
                        roi_height:
                          type: string
                          description: ROI height (%)
                          example: '10'
                        enable_body_compensation:
                          type: boolean
                          description: Temperature Correction (Celsius)
                          example: true
                        compensation_temperature:
                          type: string
                          description: Compensation Temperature
                          example: '0'
                    trigger_actions:
                      type: string
                      description: Trigger Actions
                      example: ''
                    authmode:
                      type: object
                      description: Authentication mode capabilities
                      properties:
                        id:
                          type: string
                          description: Auth mode Id
                          example: '542353521'
                        extAuthModeSupported:
                          type: boolean
                          description: Use Authmode ExtAuthModeSupported
                          example: false
                        cardAuthSupported:
                          type: boolean
                          description: Use Authmode CardAuthSupported
                          example: true
                        cardAuthMask:
                          type: string
                          description: Authmode CardAuthMask
                          example: '0'
                        fingerprintAuthSupported:
                          type: boolean
                          description: Use Authmode FingerprintAuthSupported
                          example: true
                        fingerprintAuthMask:
                          type: string
                          description: Authmode FingerprintAuthMask
                          example: '0'
                        faceAuthSupported:
                          type: boolean
                          description: Use Authmode FaceAuthSupported
                          example: false
                        faceAuthMask:
                          type: string
                          description: Authmode FaceAuthMask
                          example: '990979'
                        idAuthSupported:
                          type: boolean
                          description: Use Authmode IDAuthSupported
                          example: true
                        idAuthMask:
                          type: string
                          description: Authmode IDAuthMask
                          example: '0'
                    card_supported_from_device:
                      type: object
                      description: Card types supported by the device
                      properties:
                        mask:
                          type: string
                          description: Card Supported From Device Mask
                          example: '2147483957'
                        em4100:
                          type: boolean
                          description: Use Card Supported From Device Em4100
                          example: true
                        HIDProx:
                          type: boolean
                          description: Use Card Supported From Device HIDProx
                          example: false
                        mifare_felica:
                          type: boolean
                          description: Use Card Supported From Device Mifare Felica
                          example: true
                        iCLASS:
                          type: boolean
                          description: Use Card Supported From Device iCLASS
                          example: false
                        mifareClassic_Plus:
                          type: boolean
                          description: Use Card Supported From Device Mifare Classic Plus
                          example: true
                        Desfire_ev1:
                          type: boolean
                          description: Use Card Supported From Device Desfire EV1
                          example: true
                        iCLASSSRSE:
                          type: boolean
                          description: Use Card Supported From Device ICLASSSRSE
                          example: false
                        iCLASSSEOS:
                          type: boolean
                          description: Use Card Supported From Device ICLASSSEOS
                          example: false
                        NFC:
                          type: boolean
                          description: Use Card Supported From Device NFC
                          example: true
                        BLE:
                          type: boolean
                          description: Use Card Supported From Device BLE
                          example: false
                        use_card_operation:
                          type: boolean
                          description: Use Card Supported From Device Use Card Operation
                          example: true
                    capability:
                      type: object
                      description: Device capability information
                      properties:
                        thermalAuthSupported:
                          type: string
                          description: Capability ThermalAuthSupported
                          example: '1'
                        maskAuthSupported:
                          type: string
                          description: Capability MaskAuthSupported
                          example: '0'
                        intelligentPDSupported:
                          type: string
                          description: Capability IntelligentPDSupported
                          example: '0'
                    imageLogEventInfo:
                      type: object
                      description: Image log event information
                      properties:
                        imageLogEventItems:
                          type: array
                          description: List of image log event items
                          items:
                            type: object
                          example: []
                    use_image_log:
                      type: boolean
                      description: Use image log
                      example: false
                    dst1:
                      type: string
                      description: DST1
                      example: '0'
                    dst2:
                      type: string
                      description: DST2
                      example: '0'
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the device which will be updated
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/devices/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Device":{"name":"FaceStation 2 542353521 (192.168.1.23)","device_group_id":{"id":47,"name":"Suprema"},"lan":{"connection_mode":1,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.23","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"usb":{"enable_usb":false,"enable_usb_memory":false},"wlan":{"enabled":false,"operation_mode":0,"auth_type":0,"encryption_type":0},"rs485":{"mode":3,"intelligentInfo":{"supportIConfig":false,"useFailCode":false,"failCodeFormat":1,"failCode":"0000000000000000","osdpID":0,"cardFormat":0},"channels":[{"index":0,"mode":1,"baudrate":115200}]},"authentication":{"matching_timeout":"5","auth_timeout":"5","enable_private_auth":true,"enable_server_matching":false,"face_detection_level":"0","enable_full_access":false,"operation_modes":[{"mode":0,"schedule_id":{"id":1},"operators":[],"enable_card_Id_from_keypad":false}]},"card":{"use_csn":true,"use_mifare_felica":true,"use_em":true,"use_wiegand":false,"use_iclass":false,"use_HIDprox":false,"use_smart":true,"use_SEOS":false,"use_SR_SE":false,"use_desfire_ev1":true,"use_classic_plus":true,"use_mobile":true,"use_BLE":false,"use_NFC":true,"byte_order":"0","use_wiegand_format":false,"card_layout":{"id":"2"}},"display":{"language":"1","background":"0","background_theme":"1","volume":"50","use_voice":false,"menu_timeout":"20","message_timeout":"2000","backlight_timeout":"20","display_datetime":true,"date_type":"0","time_format":"0","home_formation":"5","shortcut_home":"","device_private_message":false,"server_private_message":false,"use_screen_saver":false,"sounds":[]},"system":{"timezone":28800,"sync_time":true,"locked":false,"interphone_type":0,"camera_frequency":"60","use_alphanumeric":false,"enable_clear_on_tamper":true,"enable_data_encryption":false,"use_card_operation":true},"wiegand":{"wiegand_in_out":"0","out_pulse_width":"40","out_pulse_interval":"10000","enable_bypass_mode":false,"format_id":{"id":"0"},"enable_fail_code":false,"fail_code":"0","wiegand_output_info":"1","wiegand_csn_id":{"id":"-1"},"wiegand_cards":[],"wiegand_inputs":[]},"tna":{"mode":"1","fixed_code":0,"required":false,"tna_keys":[{"order":1,"key":0,"keyName":"Code 1","schedule_id":{},"label":""}]},"input":{"input_port_num":"0","supervised_inputs":""},"event_filter":{"rows":[],"total":"0"},"voip":{"use":false,"server":{"address":"","user_id":"","password":"","port":""},"dtmf":{"mode":"0","exit_button":"0"},"phonebook_list":[]},"barcode":{"use_barcode":false,"scan_timeout":"4"},"pktversion":"3","support_occupancy":true,"thermal_config":{"enable_thermal_camera":"0","enable_centigrade":"1","temperature_threshold_high":"3800","enable_audit_temperature":true,"enable_temperature_reject_sound":true,"enable_overlap_thermal":true,"temperature_checkmode":"0","enable_mask":"0","mask_detection_level":"0","enable_dynamic_roi":false},"thermal_camera_config":{"distance":"100","emissivity":"98","roi_x":"47","roi_y":"45","roi_width":"15","roi_height":"10","enable_body_compensation":true,"compensation_temperature":"0"},"trigger_actions":"","authmode":{"id":"542353521","extAuthModeSupported":false,"cardAuthSupported":true,"cardAuthMask":"0","fingerprintAuthSupported":true,"fingerprintAuthMask":"0","faceAuthSupported":false,"faceAuthMask":"990979","idAuthSupported":true,"idAuthMask":"0"},"card_supported_from_device":{"mask":"2147483957","em4100":true,"HIDProx":false,"mifare_felica":true,"iCLASS":false,"mifareClassic_Plus":true,"Desfire_ev1":true,"iCLASSSRSE":false,"iCLASSSEOS":false,"NFC":true,"BLE":false,"use_card_operation":true},"capability":{"thermalAuthSupported":"1","maskAuthSupported":"0","intelligentPDSupported":"0"},"imageLogEventInfo":{"imageLogEventItems":[]},"use_image_log":false,"dst1":"0","dst2":"0"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"Device":{"name":"FaceStation 2 542353521
            (192.168.1.23)","device_group_id":{"id":47,"name":"Suprema"},"lan":{"connection_mode":1,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.23","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"usb":{"enable_usb":false,"enable_usb_memory":false},"wlan":{"enabled":false,"operation_mode":0,"auth_type":0,"encryption_type":0},"rs485":{"mode":3,"intelligentInfo":{"supportIConfig":false,"useFailCode":false,"failCodeFormat":1,"failCode":"0000000000000000","osdpID":0,"cardFormat":0},"channels":[{"index":0,"mode":1,"baudrate":115200}]},"authentication":{"matching_timeout":"5","auth_timeout":"5","enable_private_auth":true,"enable_server_matching":false,"face_detection_level":"0","enable_full_access":false,"operation_modes":[{"mode":0,"schedule_id":{"id":1},"operators":[],"enable_card_Id_from_keypad":false}]},"card":{"use_csn":true,"use_mifare_felica":true,"use_em":true,"use_wiegand":false,"use_iclass":false,"use_HIDprox":false,"use_smart":true,"use_SEOS":false,"use_SR_SE":false,"use_desfire_ev1":true,"use_classic_plus":true,"use_mobile":true,"use_BLE":false,"use_NFC":true,"byte_order":"0","use_wiegand_format":false,"card_layout":{"id":"2"}},"display":{"language":"1","background":"0","background_theme":"1","volume":"50","use_voice":false,"menu_timeout":"20","message_timeout":"2000","backlight_timeout":"20","display_datetime":true,"date_type":"0","time_format":"0","home_formation":"5","shortcut_home":"","device_private_message":false,"server_private_message":false,"use_screen_saver":false,"sounds":[]},"system":{"timezone":28800,"sync_time":true,"locked":false,"interphone_type":0,"camera_frequency":"60","use_alphanumeric":false,"enable_clear_on_tamper":true,"enable_data_encryption":false,"use_card_operation":true},"wiegand":{"wiegand_in_out":"0","out_pulse_width":"40","out_pulse_interval":"10000","enable_bypass_mode":false,"format_id":{"id":"0"},"enable_fail_code":false,"fail_code":"0","wiegand_output_info":"1","wiegand_csn_id":{"id":"-1"},"wiegand_cards":[],"wiegand_inputs":[]},"tna":{"mode":"1","fixed_code":0,"required":false,"tna_keys":[{"order":1,"key":0,"keyName":"Code
            1","schedule_id":{},"label":""}]},"input":{"input_port_num":"0","supervised_inputs":""},"event_filter":{"rows":[],"total":"0"},"voip":{"use":false,"server":{"address":"","user_id":"","password":"","port":""},"dtmf":{"mode":"0","exit_button":"0"},"phonebook_list":[]},"barcode":{"use_barcode":false,"scan_timeout":"4"},"pktversion":"3","support_occupancy":true,"thermal_config":{"enable_thermal_camera":"0","enable_centigrade":"1","temperature_threshold_high":"3800","enable_audit_temperature":true,"enable_temperature_reject_sound":true,"enable_overlap_thermal":true,"temperature_checkmode":"0","enable_mask":"0","mask_detection_level":"0","enable_dynamic_roi":false},"thermal_camera_config":{"distance":"100","emissivity":"98","roi_x":"47","roi_y":"45","roi_width":"15","roi_height":"10","enable_body_compensation":true,"compensation_temperature":"0"},"trigger_actions":"","authmode":{"id":"542353521","extAuthModeSupported":false,"cardAuthSupported":true,"cardAuthMask":"0","fingerprintAuthSupported":true,"fingerprintAuthMask":"0","faceAuthSupported":false,"faceAuthMask":"990979","idAuthSupported":true,"idAuthMask":"0"},"card_supported_from_device":{"mask":"2147483957","em4100":true,"HIDProx":false,"mifare_felica":true,"iCLASS":false,"mifareClassic_Plus":true,"Desfire_ev1":true,"iCLASSSRSE":false,"iCLASSSEOS":false,"NFC":true,"BLE":false,"use_card_operation":true},"capability":{"thermalAuthSupported":"1","maskAuthSupported":"0","intelligentPDSupported":"0"},"imageLogEventInfo":{"imageLogEventItems":[]},"use_image_log":false,"dst1":"0","dst2":"0"}}'
            |  \
              http PUT https://{baseurl}/api/devices/{id} \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Device":{"name":"FaceStation 2 542353521 (192.168.1.23)","device_group_id":{"id":47,"name":"Suprema"},"lan":{"connection_mode":1,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.23","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"usb":{"enable_usb":false,"enable_usb_memory":false},"wlan":{"enabled":false,"operation_mode":0,"auth_type":0,"encryption_type":0},"rs485":{"mode":3,"intelligentInfo":{"supportIConfig":false,"useFailCode":false,"failCodeFormat":1,"failCode":"0000000000000000","osdpID":0,"cardFormat":0},"channels":[{"index":0,"mode":1,"baudrate":115200}]},"authentication":{"matching_timeout":"5","auth_timeout":"5","enable_private_auth":true,"enable_server_matching":false,"face_detection_level":"0","enable_full_access":false,"operation_modes":[{"mode":0,"schedule_id":{"id":1},"operators":[],"enable_card_Id_from_keypad":false}]},"card":{"use_csn":true,"use_mifare_felica":true,"use_em":true,"use_wiegand":false,"use_iclass":false,"use_HIDprox":false,"use_smart":true,"use_SEOS":false,"use_SR_SE":false,"use_desfire_ev1":true,"use_classic_plus":true,"use_mobile":true,"use_BLE":false,"use_NFC":true,"byte_order":"0","use_wiegand_format":false,"card_layout":{"id":"2"}},"display":{"language":"1","background":"0","background_theme":"1","volume":"50","use_voice":false,"menu_timeout":"20","message_timeout":"2000","backlight_timeout":"20","display_datetime":true,"date_type":"0","time_format":"0","home_formation":"5","shortcut_home":"","device_private_message":false,"server_private_message":false,"use_screen_saver":false,"sounds":[]},"system":{"timezone":28800,"sync_time":true,"locked":false,"interphone_type":0,"camera_frequency":"60","use_alphanumeric":false,"enable_clear_on_tamper":true,"enable_data_encryption":false,"use_card_operation":true},"wiegand":{"wiegand_in_out":"0","out_pulse_width":"40","out_pulse_interval":"10000","enable_bypass_mode":false,"format_id":{"id":"0"},"enable_fail_code":false,"fail_code":"0","wiegand_output_info":"1","wiegand_csn_id":{"id":"-1"},"wiegand_cards":[],"wiegand_inputs":[]},"tna":{"mode":"1","fixed_code":0,"required":false,"tna_keys":[{"order":1,"key":0,"keyName":"Code 1","schedule_id":{},"label":""}]},"input":{"input_port_num":"0","supervised_inputs":""},"event_filter":{"rows":[],"total":"0"},"voip":{"use":false,"server":{"address":"","user_id":"","password":"","port":""},"dtmf":{"mode":"0","exit_button":"0"},"phonebook_list":[]},"barcode":{"use_barcode":false,"scan_timeout":"4"},"pktversion":"3","support_occupancy":true,"thermal_config":{"enable_thermal_camera":"0","enable_centigrade":"1","temperature_threshold_high":"3800","enable_audit_temperature":true,"enable_temperature_reject_sound":true,"enable_overlap_thermal":true,"temperature_checkmode":"0","enable_mask":"0","mask_detection_level":"0","enable_dynamic_roi":false},"thermal_camera_config":{"distance":"100","emissivity":"98","roi_x":"47","roi_y":"45","roi_width":"15","roi_height":"10","enable_body_compensation":true,"compensation_temperature":"0"},"trigger_actions":"","authmode":{"id":"542353521","extAuthModeSupported":false,"cardAuthSupported":true,"cardAuthMask":"0","fingerprintAuthSupported":true,"fingerprintAuthMask":"0","faceAuthSupported":false,"faceAuthMask":"990979","idAuthSupported":true,"idAuthMask":"0"},"card_supported_from_device":{"mask":"2147483957","em4100":true,"HIDProx":false,"mifare_felica":true,"iCLASS":false,"mifareClassic_Plus":true,"Desfire_ev1":true,"iCLASSSRSE":false,"iCLASSSEOS":false,"NFC":true,"BLE":false,"use_card_operation":true},"capability":{"thermalAuthSupported":"1","maskAuthSupported":"0","intelligentPDSupported":"0"},"imageLogEventInfo":{"imageLogEventItems":[]},"use_image_log":false,"dst1":"0","dst2":"0"}}' \
              --output-document \
              - https://{baseurl}/api/devices/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Device: {
                name: 'FaceStation 2 542353521 (192.168.1.23)',
                device_group_id: {id: 47, name: 'Suprema'},
                lan: {
                  connection_mode: 1,
                  enable_dhcp: false,
                  use_dns: false,
                  ip: '192.168.1.23',
                  device_port: 51211,
                  gateway: '192.168.1.1',
                  subnet_mask: '255.255.255.0',
                  server_port: 51212,
                  server_ip: '192.168.1.5'
                },
                usb: {enable_usb: false, enable_usb_memory: false},
                wlan: {enabled: false, operation_mode: 0, auth_type: 0, encryption_type: 0},
                rs485: {
                  mode: 3,
                  intelligentInfo: {
                    supportIConfig: false,
                    useFailCode: false,
                    failCodeFormat: 1,
                    failCode: '0000000000000000',
                    osdpID: 0,
                    cardFormat: 0
                  },
                  channels: [{index: 0, mode: 1, baudrate: 115200}]
                },
                authentication: {
                  matching_timeout: '5',
                  auth_timeout: '5',
                  enable_private_auth: true,
                  enable_server_matching: false,
                  face_detection_level: '0',
                  enable_full_access: false,
                  operation_modes: [
                    {
                      mode: 0,
                      schedule_id: {id: 1},
                      operators: [],
                      enable_card_Id_from_keypad: false
                    }
                  ]
                },
                card: {
                  use_csn: true,
                  use_mifare_felica: true,
                  use_em: true,
                  use_wiegand: false,
                  use_iclass: false,
                  use_HIDprox: false,
                  use_smart: true,
                  use_SEOS: false,
                  use_SR_SE: false,
                  use_desfire_ev1: true,
                  use_classic_plus: true,
                  use_mobile: true,
                  use_BLE: false,
                  use_NFC: true,
                  byte_order: '0',
                  use_wiegand_format: false,
                  card_layout: {id: '2'}
                },
                display: {
                  language: '1',
                  background: '0',
                  background_theme: '1',
                  volume: '50',
                  use_voice: false,
                  menu_timeout: '20',
                  message_timeout: '2000',
                  backlight_timeout: '20',
                  display_datetime: true,
                  date_type: '0',
                  time_format: '0',
                  home_formation: '5',
                  shortcut_home: '',
                  device_private_message: false,
                  server_private_message: false,
                  use_screen_saver: false,
                  sounds: []
                },
                system: {
                  timezone: 28800,
                  sync_time: true,
                  locked: false,
                  interphone_type: 0,
                  camera_frequency: '60',
                  use_alphanumeric: false,
                  enable_clear_on_tamper: true,
                  enable_data_encryption: false,
                  use_card_operation: true
                },
                wiegand: {
                  wiegand_in_out: '0',
                  out_pulse_width: '40',
                  out_pulse_interval: '10000',
                  enable_bypass_mode: false,
                  format_id: {id: '0'},
                  enable_fail_code: false,
                  fail_code: '0',
                  wiegand_output_info: '1',
                  wiegand_csn_id: {id: '-1'},
                  wiegand_cards: [],
                  wiegand_inputs: []
                },
                tna: {
                  mode: '1',
                  fixed_code: 0,
                  required: false,
                  tna_keys: [{order: 1, key: 0, keyName: 'Code 1', schedule_id: {}, label: ''}]
                },
                input: {input_port_num: '0', supervised_inputs: ''},
                event_filter: {rows: [], total: '0'},
                voip: {
                  use: false,
                  server: {address: '', user_id: '', password: '', port: ''},
                  dtmf: {mode: '0', exit_button: '0'},
                  phonebook_list: []
                },
                barcode: {use_barcode: false, scan_timeout: '4'},
                pktversion: '3',
                support_occupancy: true,
                thermal_config: {
                  enable_thermal_camera: '0',
                  enable_centigrade: '1',
                  temperature_threshold_high: '3800',
                  enable_audit_temperature: true,
                  enable_temperature_reject_sound: true,
                  enable_overlap_thermal: true,
                  temperature_checkmode: '0',
                  enable_mask: '0',
                  mask_detection_level: '0',
                  enable_dynamic_roi: false
                },
                thermal_camera_config: {
                  distance: '100',
                  emissivity: '98',
                  roi_x: '47',
                  roi_y: '45',
                  roi_width: '15',
                  roi_height: '10',
                  enable_body_compensation: true,
                  compensation_temperature: '0'
                },
                trigger_actions: '',
                authmode: {
                  id: '542353521',
                  extAuthModeSupported: false,
                  cardAuthSupported: true,
                  cardAuthMask: '0',
                  fingerprintAuthSupported: true,
                  fingerprintAuthMask: '0',
                  faceAuthSupported: false,
                  faceAuthMask: '990979',
                  idAuthSupported: true,
                  idAuthMask: '0'
                },
                card_supported_from_device: {
                  mask: '2147483957',
                  em4100: true,
                  HIDProx: false,
                  mifare_felica: true,
                  iCLASS: false,
                  mifareClassic_Plus: true,
                  Desfire_ev1: true,
                  iCLASSSRSE: false,
                  iCLASSSEOS: false,
                  NFC: true,
                  BLE: false,
                  use_card_operation: true
                },
                capability: {thermalAuthSupported: '1', maskAuthSupported: '0', intelligentPDSupported: '0'},
                imageLogEventInfo: {imageLogEventItems: []},
                use_image_log: false,
                dst1: '0',
                dst2: '0'
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/devices/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Device: {
                  name: 'FaceStation 2 542353521 (192.168.1.23)',
                  device_group_id: {id: 47, name: 'Suprema'},
                  lan: {
                    connection_mode: 1,
                    enable_dhcp: false,
                    use_dns: false,
                    ip: '192.168.1.23',
                    device_port: 51211,
                    gateway: '192.168.1.1',
                    subnet_mask: '255.255.255.0',
                    server_port: 51212,
                    server_ip: '192.168.1.5'
                  },
                  usb: {enable_usb: false, enable_usb_memory: false},
                  wlan: {enabled: false, operation_mode: 0, auth_type: 0, encryption_type: 0},
                  rs485: {
                    mode: 3,
                    intelligentInfo: {
                      supportIConfig: false,
                      useFailCode: false,
                      failCodeFormat: 1,
                      failCode: '0000000000000000',
                      osdpID: 0,
                      cardFormat: 0
                    },
                    channels: [{index: 0, mode: 1, baudrate: 115200}]
                  },
                  authentication: {
                    matching_timeout: '5',
                    auth_timeout: '5',
                    enable_private_auth: true,
                    enable_server_matching: false,
                    face_detection_level: '0',
                    enable_full_access: false,
                    operation_modes: [
                      {
                        mode: 0,
                        schedule_id: {id: 1},
                        operators: [],
                        enable_card_Id_from_keypad: false
                      }
                    ]
                  },
                  card: {
                    use_csn: true,
                    use_mifare_felica: true,
                    use_em: true,
                    use_wiegand: false,
                    use_iclass: false,
                    use_HIDprox: false,
                    use_smart: true,
                    use_SEOS: false,
                    use_SR_SE: false,
                    use_desfire_ev1: true,
                    use_classic_plus: true,
                    use_mobile: true,
                    use_BLE: false,
                    use_NFC: true,
                    byte_order: '0',
                    use_wiegand_format: false,
                    card_layout: {id: '2'}
                  },
                  display: {
                    language: '1',
                    background: '0',
                    background_theme: '1',
                    volume: '50',
                    use_voice: false,
                    menu_timeout: '20',
                    message_timeout: '2000',
                    backlight_timeout: '20',
                    display_datetime: true,
                    date_type: '0',
                    time_format: '0',
                    home_formation: '5',
                    shortcut_home: '',
                    device_private_message: false,
                    server_private_message: false,
                    use_screen_saver: false,
                    sounds: []
                  },
                  system: {
                    timezone: 28800,
                    sync_time: true,
                    locked: false,
                    interphone_type: 0,
                    camera_frequency: '60',
                    use_alphanumeric: false,
                    enable_clear_on_tamper: true,
                    enable_data_encryption: false,
                    use_card_operation: true
                  },
                  wiegand: {
                    wiegand_in_out: '0',
                    out_pulse_width: '40',
                    out_pulse_interval: '10000',
                    enable_bypass_mode: false,
                    format_id: {id: '0'},
                    enable_fail_code: false,
                    fail_code: '0',
                    wiegand_output_info: '1',
                    wiegand_csn_id: {id: '-1'},
                    wiegand_cards: [],
                    wiegand_inputs: []
                  },
                  tna: {
                    mode: '1',
                    fixed_code: 0,
                    required: false,
                    tna_keys: [{order: 1, key: 0, keyName: 'Code 1', schedule_id: {}, label: ''}]
                  },
                  input: {input_port_num: '0', supervised_inputs: ''},
                  event_filter: {rows: [], total: '0'},
                  voip: {
                    use: false,
                    server: {address: '', user_id: '', password: '', port: ''},
                    dtmf: {mode: '0', exit_button: '0'},
                    phonebook_list: []
                  },
                  barcode: {use_barcode: false, scan_timeout: '4'},
                  pktversion: '3',
                  support_occupancy: true,
                  thermal_config: {
                    enable_thermal_camera: '0',
                    enable_centigrade: '1',
                    temperature_threshold_high: '3800',
                    enable_audit_temperature: true,
                    enable_temperature_reject_sound: true,
                    enable_overlap_thermal: true,
                    temperature_checkmode: '0',
                    enable_mask: '0',
                    mask_detection_level: '0',
                    enable_dynamic_roi: false
                  },
                  thermal_camera_config: {
                    distance: '100',
                    emissivity: '98',
                    roi_x: '47',
                    roi_y: '45',
                    roi_width: '15',
                    roi_height: '10',
                    enable_body_compensation: true,
                    compensation_temperature: '0'
                  },
                  trigger_actions: '',
                  authmode: {
                    id: '542353521',
                    extAuthModeSupported: false,
                    cardAuthSupported: true,
                    cardAuthMask: '0',
                    fingerprintAuthSupported: true,
                    fingerprintAuthMask: '0',
                    faceAuthSupported: false,
                    faceAuthMask: '990979',
                    idAuthSupported: true,
                    idAuthMask: '0'
                  },
                  card_supported_from_device: {
                    mask: '2147483957',
                    em4100: true,
                    HIDProx: false,
                    mifare_felica: true,
                    iCLASS: false,
                    mifareClassic_Plus: true,
                    Desfire_ev1: true,
                    iCLASSSRSE: false,
                    iCLASSSEOS: false,
                    NFC: true,
                    BLE: false,
                    use_card_operation: true
                  },
                  capability: {thermalAuthSupported: '1', maskAuthSupported: '0', intelligentPDSupported: '0'},
                  imageLogEventInfo: {imageLogEventItems: []},
                  use_image_log: false,
                  dst1: '0',
                  dst2: '0'
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/devices/{id}");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Device": {
                "name": "FaceStation 2 542353521 (192.168.1.23)",
                "device_group_id": {
                  "id": 47,
                  "name": "Suprema"
                },
                "lan": {
                  "connection_mode": 1,
                  "enable_dhcp": false,
                  "use_dns": false,
                  "ip": "192.168.1.23",
                  "device_port": 51211,
                  "gateway": "192.168.1.1",
                  "subnet_mask": "255.255.255.0",
                  "server_port": 51212,
                  "server_ip": "192.168.1.5"
                },
                "usb": {
                  "enable_usb": false,
                  "enable_usb_memory": false
                },
                "wlan": {
                  "enabled": false,
                  "operation_mode": 0,
                  "auth_type": 0,
                  "encryption_type": 0
                },
                "rs485": {
                  "mode": 3,
                  "intelligentInfo": {
                    "supportIConfig": false,
                    "useFailCode": false,
                    "failCodeFormat": 1,
                    "failCode": "0000000000000000",
                    "osdpID": 0,
                    "cardFormat": 0
                  },
                  "channels": [
                    {
                      "index": 0,
                      "mode": 1,
                      "baudrate": 115200
                    }
                  ]
                },
                "authentication": {
                  "matching_timeout": "5",
                  "auth_timeout": "5",
                  "enable_private_auth": true,
                  "enable_server_matching": false,
                  "face_detection_level": "0",
                  "enable_full_access": false,
                  "operation_modes": [
                    {
                      "mode": 0,
                      "schedule_id": {
                        "id": 1
                      },
                      "operators": [],
                      "enable_card_Id_from_keypad": false
                    }
                  ]
                },
                "card": {
                  "use_csn": true,
                  "use_mifare_felica": true,
                  "use_em": true,
                  "use_wiegand": false,
                  "use_iclass": false,
                  "use_HIDprox": false,
                  "use_smart": true,
                  "use_SEOS": false,
                  "use_SR_SE": false,
                  "use_desfire_ev1": true,
                  "use_classic_plus": true,
                  "use_mobile": true,
                  "use_BLE": false,
                  "use_NFC": true,
                  "byte_order": "0",
                  "use_wiegand_format": false,
                  "card_layout": {
                    "id": "2"
                  }
                },
                "display": {
                  "language": "1",
                  "background": "0",
                  "background_theme": "1",
                  "volume": "50",
                  "use_voice": false,
                  "menu_timeout": "20",
                  "message_timeout": "2000",
                  "backlight_timeout": "20",
                  "display_datetime": true,
                  "date_type": "0",
                  "time_format": "0",
                  "home_formation": "5",
                  "shortcut_home": "",
                  "device_private_message": false,
                  "server_private_message": false,
                  "use_screen_saver": false,
                  "sounds": []
                },
                "system": {
                  "timezone": 28800,
                  "sync_time": true,
                  "locked": false,
                  "interphone_type": 0,
                  "camera_frequency": "60",
                  "use_alphanumeric": false,
                  "enable_clear_on_tamper": true,
                  "enable_data_encryption": false,
                  "use_card_operation": true
                },
                "wiegand": {
                  "wiegand_in_out": "0",
                  "out_pulse_width": "40",
                  "out_pulse_interval": "10000",
                  "enable_bypass_mode": false,
                  "format_id": {
                    "id": "0"
                  },
                  "enable_fail_code": false,
                  "fail_code": "0",
                  "wiegand_output_info": "1",
                  "wiegand_csn_id": {
                    "id": "-1"
                  },
                  "wiegand_cards": [],
                  "wiegand_inputs": []
                },
                "tna": {
                  "mode": "1",
                  "fixed_code": 0,
                  "required": false,
                  "tna_keys": [
                    {
                      "order": 1,
                      "key": 0,
                      "keyName": "Code 1",
                      "schedule_id": {},
                      "label": ""
                    }
                  ]
                },
                "input": {
                  "input_port_num": "0",
                  "supervised_inputs": ""
                },
                "event_filter": {
                  "rows": [],
                  "total": "0"
                },
                "voip": {
                  "use": false,
                  "server": {
                    "address": "",
                    "user_id": "",
                    "password": "",
                    "port": ""
                  },
                  "dtmf": {
                    "mode": "0",
                    "exit_button": "0"
                  },
                  "phonebook_list": []
                },
                "barcode": {
                  "use_barcode": false,
                  "scan_timeout": "4"
                },
                "pktversion": "3",
                "support_occupancy": true,
                "thermal_config": {
                  "enable_thermal_camera": "0",
                  "enable_centigrade": "1",
                  "temperature_threshold_high": "3800",
                  "enable_audit_temperature": true,
                  "enable_temperature_reject_sound": true,
                  "enable_overlap_thermal": true,
                  "temperature_checkmode": "0",
                  "enable_mask": "0",
                  "mask_detection_level": "0",
                  "enable_dynamic_roi": false
                },
                "thermal_camera_config": {
                  "distance": "100",
                  "emissivity": "98",
                  "roi_x": "47",
                  "roi_y": "45",
                  "roi_width": "15",
                  "roi_height": "10",
                  "enable_body_compensation": true,
                  "compensation_temperature": "0"
                },
                "trigger_actions": "",
                "authmode": {
                  "id": "542353521",
                  "extAuthModeSupported": false,
                  "cardAuthSupported": true,
                  "cardAuthMask": "0",
                  "fingerprintAuthSupported": true,
                  "fingerprintAuthMask": "0",
                  "faceAuthSupported": false,
                  "faceAuthMask": "990979",
                  "idAuthSupported": true,
                  "idAuthMask": "0"
                },
                "card_supported_from_device": {
                  "mask": "2147483957",
                  "em4100": true,
                  "HIDProx": false,
                  "mifare_felica": true,
                  "iCLASS": false,
                  "mifareClassic_Plus": true,
                  "Desfire_ev1": true,
                  "iCLASSSRSE": false,
                  "iCLASSSEOS": false,
                  "NFC": true,
                  "BLE": false,
                  "use_card_operation": true
                },
                "capability": {
                  "thermalAuthSupported": "1",
                  "maskAuthSupported": "0",
                  "intelligentPDSupported": "0"
                },
                "imageLogEventInfo": {
                  "imageLogEventItems": []
                },
                "use_image_log": false,
                "dst1": "0",
                "dst2": "0"
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/devices/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Device: {
                  name: 'FaceStation 2 542353521 (192.168.1.23)',
                  device_group_id: {id: 47, name: 'Suprema'},
                  lan: {
                    connection_mode: 1,
                    enable_dhcp: false,
                    use_dns: false,
                    ip: '192.168.1.23',
                    device_port: 51211,
                    gateway: '192.168.1.1',
                    subnet_mask: '255.255.255.0',
                    server_port: 51212,
                    server_ip: '192.168.1.5'
                  },
                  usb: {enable_usb: false, enable_usb_memory: false},
                  wlan: {enabled: false, operation_mode: 0, auth_type: 0, encryption_type: 0},
                  rs485: {
                    mode: 3,
                    intelligentInfo: {
                      supportIConfig: false,
                      useFailCode: false,
                      failCodeFormat: 1,
                      failCode: '0000000000000000',
                      osdpID: 0,
                      cardFormat: 0
                    },
                    channels: [{index: 0, mode: 1, baudrate: 115200}]
                  },
                  authentication: {
                    matching_timeout: '5',
                    auth_timeout: '5',
                    enable_private_auth: true,
                    enable_server_matching: false,
                    face_detection_level: '0',
                    enable_full_access: false,
                    operation_modes: [
                      {
                        mode: 0,
                        schedule_id: {id: 1},
                        operators: [],
                        enable_card_Id_from_keypad: false
                      }
                    ]
                  },
                  card: {
                    use_csn: true,
                    use_mifare_felica: true,
                    use_em: true,
                    use_wiegand: false,
                    use_iclass: false,
                    use_HIDprox: false,
                    use_smart: true,
                    use_SEOS: false,
                    use_SR_SE: false,
                    use_desfire_ev1: true,
                    use_classic_plus: true,
                    use_mobile: true,
                    use_BLE: false,
                    use_NFC: true,
                    byte_order: '0',
                    use_wiegand_format: false,
                    card_layout: {id: '2'}
                  },
                  display: {
                    language: '1',
                    background: '0',
                    background_theme: '1',
                    volume: '50',
                    use_voice: false,
                    menu_timeout: '20',
                    message_timeout: '2000',
                    backlight_timeout: '20',
                    display_datetime: true,
                    date_type: '0',
                    time_format: '0',
                    home_formation: '5',
                    shortcut_home: '',
                    device_private_message: false,
                    server_private_message: false,
                    use_screen_saver: false,
                    sounds: []
                  },
                  system: {
                    timezone: 28800,
                    sync_time: true,
                    locked: false,
                    interphone_type: 0,
                    camera_frequency: '60',
                    use_alphanumeric: false,
                    enable_clear_on_tamper: true,
                    enable_data_encryption: false,
                    use_card_operation: true
                  },
                  wiegand: {
                    wiegand_in_out: '0',
                    out_pulse_width: '40',
                    out_pulse_interval: '10000',
                    enable_bypass_mode: false,
                    format_id: {id: '0'},
                    enable_fail_code: false,
                    fail_code: '0',
                    wiegand_output_info: '1',
                    wiegand_csn_id: {id: '-1'},
                    wiegand_cards: [],
                    wiegand_inputs: []
                  },
                  tna: {
                    mode: '1',
                    fixed_code: 0,
                    required: false,
                    tna_keys: [{order: 1, key: 0, keyName: 'Code 1', schedule_id: {}, label: ''}]
                  },
                  input: {input_port_num: '0', supervised_inputs: ''},
                  event_filter: {rows: [], total: '0'},
                  voip: {
                    use: false,
                    server: {address: '', user_id: '', password: '', port: ''},
                    dtmf: {mode: '0', exit_button: '0'},
                    phonebook_list: []
                  },
                  barcode: {use_barcode: false, scan_timeout: '4'},
                  pktversion: '3',
                  support_occupancy: true,
                  thermal_config: {
                    enable_thermal_camera: '0',
                    enable_centigrade: '1',
                    temperature_threshold_high: '3800',
                    enable_audit_temperature: true,
                    enable_temperature_reject_sound: true,
                    enable_overlap_thermal: true,
                    temperature_checkmode: '0',
                    enable_mask: '0',
                    mask_detection_level: '0',
                    enable_dynamic_roi: false
                  },
                  thermal_camera_config: {
                    distance: '100',
                    emissivity: '98',
                    roi_x: '47',
                    roi_y: '45',
                    roi_width: '15',
                    roi_height: '10',
                    enable_body_compensation: true,
                    compensation_temperature: '0'
                  },
                  trigger_actions: '',
                  authmode: {
                    id: '542353521',
                    extAuthModeSupported: false,
                    cardAuthSupported: true,
                    cardAuthMask: '0',
                    fingerprintAuthSupported: true,
                    fingerprintAuthMask: '0',
                    faceAuthSupported: false,
                    faceAuthMask: '990979',
                    idAuthSupported: true,
                    idAuthMask: '0'
                  },
                  card_supported_from_device: {
                    mask: '2147483957',
                    em4100: true,
                    HIDProx: false,
                    mifare_felica: true,
                    iCLASS: false,
                    mifareClassic_Plus: true,
                    Desfire_ev1: true,
                    iCLASSSRSE: false,
                    iCLASSSEOS: false,
                    NFC: true,
                    BLE: false,
                    use_card_operation: true
                  },
                  capability: {thermalAuthSupported: '1', maskAuthSupported: '0', intelligentPDSupported: '0'},
                  imageLogEventInfo: {imageLogEventItems: []},
                  use_image_log: false,
                  dst1: '0',
                  dst2: '0'
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/devices/{id}';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Device":{"name":"FaceStation 2 542353521 (192.168.1.23)","device_group_id":{"id":47,"name":"Suprema"},"lan":{"connection_mode":1,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.23","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"usb":{"enable_usb":false,"enable_usb_memory":false},"wlan":{"enabled":false,"operation_mode":0,"auth_type":0,"encryption_type":0},"rs485":{"mode":3,"intelligentInfo":{"supportIConfig":false,"useFailCode":false,"failCodeFormat":1,"failCode":"0000000000000000","osdpID":0,"cardFormat":0},"channels":[{"index":0,"mode":1,"baudrate":115200}]},"authentication":{"matching_timeout":"5","auth_timeout":"5","enable_private_auth":true,"enable_server_matching":false,"face_detection_level":"0","enable_full_access":false,"operation_modes":[{"mode":0,"schedule_id":{"id":1},"operators":[],"enable_card_Id_from_keypad":false}]},"card":{"use_csn":true,"use_mifare_felica":true,"use_em":true,"use_wiegand":false,"use_iclass":false,"use_HIDprox":false,"use_smart":true,"use_SEOS":false,"use_SR_SE":false,"use_desfire_ev1":true,"use_classic_plus":true,"use_mobile":true,"use_BLE":false,"use_NFC":true,"byte_order":"0","use_wiegand_format":false,"card_layout":{"id":"2"}},"display":{"language":"1","background":"0","background_theme":"1","volume":"50","use_voice":false,"menu_timeout":"20","message_timeout":"2000","backlight_timeout":"20","display_datetime":true,"date_type":"0","time_format":"0","home_formation":"5","shortcut_home":"","device_private_message":false,"server_private_message":false,"use_screen_saver":false,"sounds":[]},"system":{"timezone":28800,"sync_time":true,"locked":false,"interphone_type":0,"camera_frequency":"60","use_alphanumeric":false,"enable_clear_on_tamper":true,"enable_data_encryption":false,"use_card_operation":true},"wiegand":{"wiegand_in_out":"0","out_pulse_width":"40","out_pulse_interval":"10000","enable_bypass_mode":false,"format_id":{"id":"0"},"enable_fail_code":false,"fail_code":"0","wiegand_output_info":"1","wiegand_csn_id":{"id":"-1"},"wiegand_cards":[],"wiegand_inputs":[]},"tna":{"mode":"1","fixed_code":0,"required":false,"tna_keys":[{"order":1,"key":0,"keyName":"Code 1","schedule_id":{},"label":""}]},"input":{"input_port_num":"0","supervised_inputs":""},"event_filter":{"rows":[],"total":"0"},"voip":{"use":false,"server":{"address":"","user_id":"","password":"","port":""},"dtmf":{"mode":"0","exit_button":"0"},"phonebook_list":[]},"barcode":{"use_barcode":false,"scan_timeout":"4"},"pktversion":"3","support_occupancy":true,"thermal_config":{"enable_thermal_camera":"0","enable_centigrade":"1","temperature_threshold_high":"3800","enable_audit_temperature":true,"enable_temperature_reject_sound":true,"enable_overlap_thermal":true,"temperature_checkmode":"0","enable_mask":"0","mask_detection_level":"0","enable_dynamic_roi":false},"thermal_camera_config":{"distance":"100","emissivity":"98","roi_x":"47","roi_y":"45","roi_width":"15","roi_height":"10","enable_body_compensation":true,"compensation_temperature":"0"},"trigger_actions":"","authmode":{"id":"542353521","extAuthModeSupported":false,"cardAuthSupported":true,"cardAuthMask":"0","fingerprintAuthSupported":true,"fingerprintAuthMask":"0","faceAuthSupported":false,"faceAuthMask":"990979","idAuthSupported":true,"idAuthMask":"0"},"card_supported_from_device":{"mask":"2147483957","em4100":true,"HIDProx":false,"mifare_felica":true,"iCLASS":false,"mifareClassic_Plus":true,"Desfire_ev1":true,"iCLASSSRSE":false,"iCLASSSEOS":false,"NFC":true,"BLE":false,"use_card_operation":true},"capability":{"thermalAuthSupported":"1","maskAuthSupported":"0","intelligentPDSupported":"0"},"imageLogEventInfo":{"imageLogEventItems":[]},"use_image_log":false,"dst1":"0","dst2":"0"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Device":{"name":"FaceStation 2 542353521 (192.168.1.23)","device_group_id":{"id":47,"name":"Suprema"},"lan":{"connection_mode":1,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.23","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"usb":{"enable_usb":false,"enable_usb_memory":false},"wlan":{"enabled":false,"operation_mode":0,"auth_type":0,"encryption_type":0},"rs485":{"mode":3,"intelligentInfo":{"supportIConfig":false,"useFailCode":false,"failCodeFormat":1,"failCode":"0000000000000000","osdpID":0,"cardFormat":0},"channels":[{"index":0,"mode":1,"baudrate":115200}]},"authentication":{"matching_timeout":"5","auth_timeout":"5","enable_private_auth":true,"enable_server_matching":false,"face_detection_level":"0","enable_full_access":false,"operation_modes":[{"mode":0,"schedule_id":{"id":1},"operators":[],"enable_card_Id_from_keypad":false}]},"card":{"use_csn":true,"use_mifare_felica":true,"use_em":true,"use_wiegand":false,"use_iclass":false,"use_HIDprox":false,"use_smart":true,"use_SEOS":false,"use_SR_SE":false,"use_desfire_ev1":true,"use_classic_plus":true,"use_mobile":true,"use_BLE":false,"use_NFC":true,"byte_order":"0","use_wiegand_format":false,"card_layout":{"id":"2"}},"display":{"language":"1","background":"0","background_theme":"1","volume":"50","use_voice":false,"menu_timeout":"20","message_timeout":"2000","backlight_timeout":"20","display_datetime":true,"date_type":"0","time_format":"0","home_formation":"5","shortcut_home":"","device_private_message":false,"server_private_message":false,"use_screen_saver":false,"sounds":[]},"system":{"timezone":28800,"sync_time":true,"locked":false,"interphone_type":0,"camera_frequency":"60","use_alphanumeric":false,"enable_clear_on_tamper":true,"enable_data_encryption":false,"use_card_operation":true},"wiegand":{"wiegand_in_out":"0","out_pulse_width":"40","out_pulse_interval":"10000","enable_bypass_mode":false,"format_id":{"id":"0"},"enable_fail_code":false,"fail_code":"0","wiegand_output_info":"1","wiegand_csn_id":{"id":"-1"},"wiegand_cards":[],"wiegand_inputs":[]},"tna":{"mode":"1","fixed_code":0,"required":false,"tna_keys":[{"order":1,"key":0,"keyName":"Code 1","schedule_id":{},"label":""}]},"input":{"input_port_num":"0","supervised_inputs":""},"event_filter":{"rows":[],"total":"0"},"voip":{"use":false,"server":{"address":"","user_id":"","password":"","port":""},"dtmf":{"mode":"0","exit_button":"0"},"phonebook_list":[]},"barcode":{"use_barcode":false,"scan_timeout":"4"},"pktversion":"3","support_occupancy":true,"thermal_config":{"enable_thermal_camera":"0","enable_centigrade":"1","temperature_threshold_high":"3800","enable_audit_temperature":true,"enable_temperature_reject_sound":true,"enable_overlap_thermal":true,"temperature_checkmode":"0","enable_mask":"0","mask_detection_level":"0","enable_dynamic_roi":false},"thermal_camera_config":{"distance":"100","emissivity":"98","roi_x":"47","roi_y":"45","roi_width":"15","roi_height":"10","enable_body_compensation":true,"compensation_temperature":"0"},"trigger_actions":"","authmode":{"id":"542353521","extAuthModeSupported":false,"cardAuthSupported":true,"cardAuthMask":"0","fingerprintAuthSupported":true,"fingerprintAuthMask":"0","faceAuthSupported":false,"faceAuthMask":"990979","idAuthSupported":true,"idAuthMask":"0"},"card_supported_from_device":{"mask":"2147483957","em4100":true,"HIDProx":false,"mifare_felica":true,"iCLASS":false,"mifareClassic_Plus":true,"Desfire_ev1":true,"iCLASSSRSE":false,"iCLASSSEOS":false,"NFC":true,"BLE":false,"use_card_operation":true},"capability":{"thermalAuthSupported":"1","maskAuthSupported":"0","intelligentPDSupported":"0"},"imageLogEventInfo":{"imageLogEventItems":[]},"use_image_log":false,"dst1":"0","dst2":"0"}}'
            };

            fetch('https://{baseurl}/api/devices/{id}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/{id}",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Device\":{\"name\":\"FaceStation 2 542353521 (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code 1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Device": {
                "name": "FaceStation 2 542353521 (192.168.1.23)",
                "device_group_id": {
                  "id": 47,
                  "name": "Suprema"
                },
                "lan": {
                  "connection_mode": 1,
                  "enable_dhcp": false,
                  "use_dns": false,
                  "ip": "192.168.1.23",
                  "device_port": 51211,
                  "gateway": "192.168.1.1",
                  "subnet_mask": "255.255.255.0",
                  "server_port": 51212,
                  "server_ip": "192.168.1.5"
                },
                "usb": {
                  "enable_usb": false,
                  "enable_usb_memory": false
                },
                "wlan": {
                  "enabled": false,
                  "operation_mode": 0,
                  "auth_type": 0,
                  "encryption_type": 0
                },
                "rs485": {
                  "mode": 3,
                  "intelligentInfo": {
                    "supportIConfig": false,
                    "useFailCode": false,
                    "failCodeFormat": 1,
                    "failCode": "0000000000000000",
                    "osdpID": 0,
                    "cardFormat": 0
                  },
                  "channels": [
                    {
                      "index": 0,
                      "mode": 1,
                      "baudrate": 115200
                    }
                  ]
                },
                "authentication": {
                  "matching_timeout": "5",
                  "auth_timeout": "5",
                  "enable_private_auth": true,
                  "enable_server_matching": false,
                  "face_detection_level": "0",
                  "enable_full_access": false,
                  "operation_modes": [
                    {
                      "mode": 0,
                      "schedule_id": {
                        "id": 1
                      },
                      "operators": [],
                      "enable_card_Id_from_keypad": false
                    }
                  ]
                },
                "card": {
                  "use_csn": true,
                  "use_mifare_felica": true,
                  "use_em": true,
                  "use_wiegand": false,
                  "use_iclass": false,
                  "use_HIDprox": false,
                  "use_smart": true,
                  "use_SEOS": false,
                  "use_SR_SE": false,
                  "use_desfire_ev1": true,
                  "use_classic_plus": true,
                  "use_mobile": true,
                  "use_BLE": false,
                  "use_NFC": true,
                  "byte_order": "0",
                  "use_wiegand_format": false,
                  "card_layout": {
                    "id": "2"
                  }
                },
                "display": {
                  "language": "1",
                  "background": "0",
                  "background_theme": "1",
                  "volume": "50",
                  "use_voice": false,
                  "menu_timeout": "20",
                  "message_timeout": "2000",
                  "backlight_timeout": "20",
                  "display_datetime": true,
                  "date_type": "0",
                  "time_format": "0",
                  "home_formation": "5",
                  "shortcut_home": "",
                  "device_private_message": false,
                  "server_private_message": false,
                  "use_screen_saver": false,
                  "sounds": []
                },
                "system": {
                  "timezone": 28800,
                  "sync_time": true,
                  "locked": false,
                  "interphone_type": 0,
                  "camera_frequency": "60",
                  "use_alphanumeric": false,
                  "enable_clear_on_tamper": true,
                  "enable_data_encryption": false,
                  "use_card_operation": true
                },
                "wiegand": {
                  "wiegand_in_out": "0",
                  "out_pulse_width": "40",
                  "out_pulse_interval": "10000",
                  "enable_bypass_mode": false,
                  "format_id": {
                    "id": "0"
                  },
                  "enable_fail_code": false,
                  "fail_code": "0",
                  "wiegand_output_info": "1",
                  "wiegand_csn_id": {
                    "id": "-1"
                  },
                  "wiegand_cards": [],
                  "wiegand_inputs": []
                },
                "tna": {
                  "mode": "1",
                  "fixed_code": 0,
                  "required": false,
                  "tna_keys": [
                    {
                      "order": 1,
                      "key": 0,
                      "keyName": "Code 1",
                      "schedule_id": {},
                      "label": ""
                    }
                  ]
                },
                "input": {
                  "input_port_num": "0",
                  "supervised_inputs": ""
                },
                "event_filter": {
                  "rows": [],
                  "total": "0"
                },
                "voip": {
                  "use": false,
                  "server": {
                    "address": "",
                    "user_id": "",
                    "password": "",
                    "port": ""
                  },
                  "dtmf": {
                    "mode": "0",
                    "exit_button": "0"
                  },
                  "phonebook_list": []
                },
                "barcode": {
                  "use_barcode": false,
                  "scan_timeout": "4"
                },
                "pktversion": "3",
                "support_occupancy": true,
                "thermal_config": {
                  "enable_thermal_camera": "0",
                  "enable_centigrade": "1",
                  "temperature_threshold_high": "3800",
                  "enable_audit_temperature": true,
                  "enable_temperature_reject_sound": true,
                  "enable_overlap_thermal": true,
                  "temperature_checkmode": "0",
                  "enable_mask": "0",
                  "mask_detection_level": "0",
                  "enable_dynamic_roi": false
                },
                "thermal_camera_config": {
                  "distance": "100",
                  "emissivity": "98",
                  "roi_x": "47",
                  "roi_y": "45",
                  "roi_width": "15",
                  "roi_height": "10",
                  "enable_body_compensation": true,
                  "compensation_temperature": "0"
                },
                "trigger_actions": "",
                "authmode": {
                  "id": "542353521",
                  "extAuthModeSupported": false,
                  "cardAuthSupported": true,
                  "cardAuthMask": "0",
                  "fingerprintAuthSupported": true,
                  "fingerprintAuthMask": "0",
                  "faceAuthSupported": false,
                  "faceAuthMask": "990979",
                  "idAuthSupported": true,
                  "idAuthMask": "0"
                },
                "card_supported_from_device": {
                  "mask": "2147483957",
                  "em4100": true,
                  "HIDProx": false,
                  "mifare_felica": true,
                  "iCLASS": false,
                  "mifareClassic_Plus": true,
                  "Desfire_ev1": true,
                  "iCLASSSRSE": false,
                  "iCLASSSEOS": false,
                  "NFC": true,
                  "BLE": false,
                  "use_card_operation": true
                },
                "capability": {
                  "thermalAuthSupported": "1",
                  "maskAuthSupported": "0",
                  "intelligentPDSupported": "0"
                },
                "imageLogEventInfo": {
                  "imageLogEventItems": []
                },
                "use_image_log": false,
                "dst1": "0",
                "dst2": "0"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/devices/{id}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"Device\":{\"name\":\"FaceStation 2 542353521
            (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code
            1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/devices/{id}", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/{id}"


            payload = {"Device": {
                    "name": "FaceStation 2 542353521 (192.168.1.23)",
                    "device_group_id": {
                        "id": 47,
                        "name": "Suprema"
                    },
                    "lan": {
                        "connection_mode": 1,
                        "enable_dhcp": False,
                        "use_dns": False,
                        "ip": "192.168.1.23",
                        "device_port": 51211,
                        "gateway": "192.168.1.1",
                        "subnet_mask": "255.255.255.0",
                        "server_port": 51212,
                        "server_ip": "192.168.1.5"
                    },
                    "usb": {
                        "enable_usb": False,
                        "enable_usb_memory": False
                    },
                    "wlan": {
                        "enabled": False,
                        "operation_mode": 0,
                        "auth_type": 0,
                        "encryption_type": 0
                    },
                    "rs485": {
                        "mode": 3,
                        "intelligentInfo": {
                            "supportIConfig": False,
                            "useFailCode": False,
                            "failCodeFormat": 1,
                            "failCode": "0000000000000000",
                            "osdpID": 0,
                            "cardFormat": 0
                        },
                        "channels": [
                            {
                                "index": 0,
                                "mode": 1,
                                "baudrate": 115200
                            }
                        ]
                    },
                    "authentication": {
                        "matching_timeout": "5",
                        "auth_timeout": "5",
                        "enable_private_auth": True,
                        "enable_server_matching": False,
                        "face_detection_level": "0",
                        "enable_full_access": False,
                        "operation_modes": [
                            {
                                "mode": 0,
                                "schedule_id": {"id": 1},
                                "operators": [],
                                "enable_card_Id_from_keypad": False
                            }
                        ]
                    },
                    "card": {
                        "use_csn": True,
                        "use_mifare_felica": True,
                        "use_em": True,
                        "use_wiegand": False,
                        "use_iclass": False,
                        "use_HIDprox": False,
                        "use_smart": True,
                        "use_SEOS": False,
                        "use_SR_SE": False,
                        "use_desfire_ev1": True,
                        "use_classic_plus": True,
                        "use_mobile": True,
                        "use_BLE": False,
                        "use_NFC": True,
                        "byte_order": "0",
                        "use_wiegand_format": False,
                        "card_layout": {"id": "2"}
                    },
                    "display": {
                        "language": "1",
                        "background": "0",
                        "background_theme": "1",
                        "volume": "50",
                        "use_voice": False,
                        "menu_timeout": "20",
                        "message_timeout": "2000",
                        "backlight_timeout": "20",
                        "display_datetime": True,
                        "date_type": "0",
                        "time_format": "0",
                        "home_formation": "5",
                        "shortcut_home": "",
                        "device_private_message": False,
                        "server_private_message": False,
                        "use_screen_saver": False,
                        "sounds": []
                    },
                    "system": {
                        "timezone": 28800,
                        "sync_time": True,
                        "locked": False,
                        "interphone_type": 0,
                        "camera_frequency": "60",
                        "use_alphanumeric": False,
                        "enable_clear_on_tamper": True,
                        "enable_data_encryption": False,
                        "use_card_operation": True
                    },
                    "wiegand": {
                        "wiegand_in_out": "0",
                        "out_pulse_width": "40",
                        "out_pulse_interval": "10000",
                        "enable_bypass_mode": False,
                        "format_id": {"id": "0"},
                        "enable_fail_code": False,
                        "fail_code": "0",
                        "wiegand_output_info": "1",
                        "wiegand_csn_id": {"id": "-1"},
                        "wiegand_cards": [],
                        "wiegand_inputs": []
                    },
                    "tna": {
                        "mode": "1",
                        "fixed_code": 0,
                        "required": False,
                        "tna_keys": [
                            {
                                "order": 1,
                                "key": 0,
                                "keyName": "Code 1",
                                "schedule_id": {},
                                "label": ""
                            }
                        ]
                    },
                    "input": {
                        "input_port_num": "0",
                        "supervised_inputs": ""
                    },
                    "event_filter": {
                        "rows": [],
                        "total": "0"
                    },
                    "voip": {
                        "use": False,
                        "server": {
                            "address": "",
                            "user_id": "",
                            "password": "",
                            "port": ""
                        },
                        "dtmf": {
                            "mode": "0",
                            "exit_button": "0"
                        },
                        "phonebook_list": []
                    },
                    "barcode": {
                        "use_barcode": False,
                        "scan_timeout": "4"
                    },
                    "pktversion": "3",
                    "support_occupancy": True,
                    "thermal_config": {
                        "enable_thermal_camera": "0",
                        "enable_centigrade": "1",
                        "temperature_threshold_high": "3800",
                        "enable_audit_temperature": True,
                        "enable_temperature_reject_sound": True,
                        "enable_overlap_thermal": True,
                        "temperature_checkmode": "0",
                        "enable_mask": "0",
                        "mask_detection_level": "0",
                        "enable_dynamic_roi": False
                    },
                    "thermal_camera_config": {
                        "distance": "100",
                        "emissivity": "98",
                        "roi_x": "47",
                        "roi_y": "45",
                        "roi_width": "15",
                        "roi_height": "10",
                        "enable_body_compensation": True,
                        "compensation_temperature": "0"
                    },
                    "trigger_actions": "",
                    "authmode": {
                        "id": "542353521",
                        "extAuthModeSupported": False,
                        "cardAuthSupported": True,
                        "cardAuthMask": "0",
                        "fingerprintAuthSupported": True,
                        "fingerprintAuthMask": "0",
                        "faceAuthSupported": False,
                        "faceAuthMask": "990979",
                        "idAuthSupported": True,
                        "idAuthMask": "0"
                    },
                    "card_supported_from_device": {
                        "mask": "2147483957",
                        "em4100": True,
                        "HIDProx": False,
                        "mifare_felica": True,
                        "iCLASS": False,
                        "mifareClassic_Plus": True,
                        "Desfire_ev1": True,
                        "iCLASSSRSE": False,
                        "iCLASSSEOS": False,
                        "NFC": True,
                        "BLE": False,
                        "use_card_operation": True
                    },
                    "capability": {
                        "thermalAuthSupported": "1",
                        "maskAuthSupported": "0",
                        "intelligentPDSupported": "0"
                    },
                    "imageLogEventInfo": {"imageLogEventItems": []},
                    "use_image_log": False,
                    "dst1": "0",
                    "dst2": "0"
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/devices/{id}")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"Device\":{\"name\":\"FaceStation 2 542353521
            (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code
            1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"Device\":{\"name\":\"FaceStation 2 542353521 (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code 1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/{id}');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Device":{"name":"FaceStation 2 542353521
            (192.168.1.23)","device_group_id":{"id":47,"name":"Suprema"},"lan":{"connection_mode":1,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.23","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"usb":{"enable_usb":false,"enable_usb_memory":false},"wlan":{"enabled":false,"operation_mode":0,"auth_type":0,"encryption_type":0},"rs485":{"mode":3,"intelligentInfo":{"supportIConfig":false,"useFailCode":false,"failCodeFormat":1,"failCode":"0000000000000000","osdpID":0,"cardFormat":0},"channels":[{"index":0,"mode":1,"baudrate":115200}]},"authentication":{"matching_timeout":"5","auth_timeout":"5","enable_private_auth":true,"enable_server_matching":false,"face_detection_level":"0","enable_full_access":false,"operation_modes":[{"mode":0,"schedule_id":{"id":1},"operators":[],"enable_card_Id_from_keypad":false}]},"card":{"use_csn":true,"use_mifare_felica":true,"use_em":true,"use_wiegand":false,"use_iclass":false,"use_HIDprox":false,"use_smart":true,"use_SEOS":false,"use_SR_SE":false,"use_desfire_ev1":true,"use_classic_plus":true,"use_mobile":true,"use_BLE":false,"use_NFC":true,"byte_order":"0","use_wiegand_format":false,"card_layout":{"id":"2"}},"display":{"language":"1","background":"0","background_theme":"1","volume":"50","use_voice":false,"menu_timeout":"20","message_timeout":"2000","backlight_timeout":"20","display_datetime":true,"date_type":"0","time_format":"0","home_formation":"5","shortcut_home":"","device_private_message":false,"server_private_message":false,"use_screen_saver":false,"sounds":[]},"system":{"timezone":28800,"sync_time":true,"locked":false,"interphone_type":0,"camera_frequency":"60","use_alphanumeric":false,"enable_clear_on_tamper":true,"enable_data_encryption":false,"use_card_operation":true},"wiegand":{"wiegand_in_out":"0","out_pulse_width":"40","out_pulse_interval":"10000","enable_bypass_mode":false,"format_id":{"id":"0"},"enable_fail_code":false,"fail_code":"0","wiegand_output_info":"1","wiegand_csn_id":{"id":"-1"},"wiegand_cards":[],"wiegand_inputs":[]},"tna":{"mode":"1","fixed_code":0,"required":false,"tna_keys":[{"order":1,"key":0,"keyName":"Code
            1","schedule_id":{},"label":""}]},"input":{"input_port_num":"0","supervised_inputs":""},"event_filter":{"rows":[],"total":"0"},"voip":{"use":false,"server":{"address":"","user_id":"","password":"","port":""},"dtmf":{"mode":"0","exit_button":"0"},"phonebook_list":[]},"barcode":{"use_barcode":false,"scan_timeout":"4"},"pktversion":"3","support_occupancy":true,"thermal_config":{"enable_thermal_camera":"0","enable_centigrade":"1","temperature_threshold_high":"3800","enable_audit_temperature":true,"enable_temperature_reject_sound":true,"enable_overlap_thermal":true,"temperature_checkmode":"0","enable_mask":"0","mask_detection_level":"0","enable_dynamic_roi":false},"thermal_camera_config":{"distance":"100","emissivity":"98","roi_x":"47","roi_y":"45","roi_width":"15","roi_height":"10","enable_body_compensation":true,"compensation_temperature":"0"},"trigger_actions":"","authmode":{"id":"542353521","extAuthModeSupported":false,"cardAuthSupported":true,"cardAuthMask":"0","fingerprintAuthSupported":true,"fingerprintAuthMask":"0","faceAuthSupported":false,"faceAuthMask":"990979","idAuthSupported":true,"idAuthMask":"0"},"card_supported_from_device":{"mask":"2147483957","em4100":true,"HIDProx":false,"mifare_felica":true,"iCLASS":false,"mifareClassic_Plus":true,"Desfire_ev1":true,"iCLASSSRSE":false,"iCLASSSEOS":false,"NFC":true,"BLE":false,"use_card_operation":true},"capability":{"thermalAuthSupported":"1","maskAuthSupported":"0","intelligentPDSupported":"0"},"imageLogEventInfo":{"imageLogEventItems":[]},"use_image_log":false,"dst1":"0","dst2":"0"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Device":{"name":"FaceStation 2 542353521
            (192.168.1.23)","device_group_id":{"id":47,"name":"Suprema"},"lan":{"connection_mode":1,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.23","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"usb":{"enable_usb":false,"enable_usb_memory":false},"wlan":{"enabled":false,"operation_mode":0,"auth_type":0,"encryption_type":0},"rs485":{"mode":3,"intelligentInfo":{"supportIConfig":false,"useFailCode":false,"failCodeFormat":1,"failCode":"0000000000000000","osdpID":0,"cardFormat":0},"channels":[{"index":0,"mode":1,"baudrate":115200}]},"authentication":{"matching_timeout":"5","auth_timeout":"5","enable_private_auth":true,"enable_server_matching":false,"face_detection_level":"0","enable_full_access":false,"operation_modes":[{"mode":0,"schedule_id":{"id":1},"operators":[],"enable_card_Id_from_keypad":false}]},"card":{"use_csn":true,"use_mifare_felica":true,"use_em":true,"use_wiegand":false,"use_iclass":false,"use_HIDprox":false,"use_smart":true,"use_SEOS":false,"use_SR_SE":false,"use_desfire_ev1":true,"use_classic_plus":true,"use_mobile":true,"use_BLE":false,"use_NFC":true,"byte_order":"0","use_wiegand_format":false,"card_layout":{"id":"2"}},"display":{"language":"1","background":"0","background_theme":"1","volume":"50","use_voice":false,"menu_timeout":"20","message_timeout":"2000","backlight_timeout":"20","display_datetime":true,"date_type":"0","time_format":"0","home_formation":"5","shortcut_home":"","device_private_message":false,"server_private_message":false,"use_screen_saver":false,"sounds":[]},"system":{"timezone":28800,"sync_time":true,"locked":false,"interphone_type":0,"camera_frequency":"60","use_alphanumeric":false,"enable_clear_on_tamper":true,"enable_data_encryption":false,"use_card_operation":true},"wiegand":{"wiegand_in_out":"0","out_pulse_width":"40","out_pulse_interval":"10000","enable_bypass_mode":false,"format_id":{"id":"0"},"enable_fail_code":false,"fail_code":"0","wiegand_output_info":"1","wiegand_csn_id":{"id":"-1"},"wiegand_cards":[],"wiegand_inputs":[]},"tna":{"mode":"1","fixed_code":0,"required":false,"tna_keys":[{"order":1,"key":0,"keyName":"Code
            1","schedule_id":{},"label":""}]},"input":{"input_port_num":"0","supervised_inputs":""},"event_filter":{"rows":[],"total":"0"},"voip":{"use":false,"server":{"address":"","user_id":"","password":"","port":""},"dtmf":{"mode":"0","exit_button":"0"},"phonebook_list":[]},"barcode":{"use_barcode":false,"scan_timeout":"4"},"pktversion":"3","support_occupancy":true,"thermal_config":{"enable_thermal_camera":"0","enable_centigrade":"1","temperature_threshold_high":"3800","enable_audit_temperature":true,"enable_temperature_reject_sound":true,"enable_overlap_thermal":true,"temperature_checkmode":"0","enable_mask":"0","mask_detection_level":"0","enable_dynamic_roi":false},"thermal_camera_config":{"distance":"100","emissivity":"98","roi_x":"47","roi_y":"45","roi_width":"15","roi_height":"10","enable_body_compensation":true,"compensation_temperature":"0"},"trigger_actions":"","authmode":{"id":"542353521","extAuthModeSupported":false,"cardAuthSupported":true,"cardAuthMask":"0","fingerprintAuthSupported":true,"fingerprintAuthMask":"0","faceAuthSupported":false,"faceAuthMask":"990979","idAuthSupported":true,"idAuthMask":"0"},"card_supported_from_device":{"mask":"2147483957","em4100":true,"HIDProx":false,"mifare_felica":true,"iCLASS":false,"mifareClassic_Plus":true,"Desfire_ev1":true,"iCLASSSRSE":false,"iCLASSSEOS":false,"NFC":true,"BLE":false,"use_card_operation":true},"capability":{"thermalAuthSupported":"1","maskAuthSupported":"0","intelligentPDSupported":"0"},"imageLogEventInfo":{"imageLogEventItems":[]},"use_image_log":false,"dst1":"0","dst2":"0"}}');


            $request->setRequestUrl('https://{baseurl}/api/devices/{id}');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Device\":{\"name\":\"FaceStation 2 542353521
            (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code
            1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/devices/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Device\":{\"name\":\"FaceStation 2 542353521 (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code 1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/{id}\"\n\n\tpayload := strings.NewReader(\"{\\\"Device\\\":{\\\"name\\\":\\\"FaceStation 2 542353521 (192.168.1.23)\\\",\\\"device_group_id\\\":{\\\"id\\\":47,\\\"name\\\":\\\"Suprema\\\"},\\\"lan\\\":{\\\"connection_mode\\\":1,\\\"enable_dhcp\\\":false,\\\"use_dns\\\":false,\\\"ip\\\":\\\"192.168.1.23\\\",\\\"device_port\\\":51211,\\\"gateway\\\":\\\"192.168.1.1\\\",\\\"subnet_mask\\\":\\\"255.255.255.0\\\",\\\"server_port\\\":51212,\\\"server_ip\\\":\\\"192.168.1.5\\\"},\\\"usb\\\":{\\\"enable_usb\\\":false,\\\"enable_usb_memory\\\":false},\\\"wlan\\\":{\\\"enabled\\\":false,\\\"operation_mode\\\":0,\\\"auth_type\\\":0,\\\"encryption_type\\\":0},\\\"rs485\\\":{\\\"mode\\\":3,\\\"intelligentInfo\\\":{\\\"supportIConfig\\\":false,\\\"useFailCode\\\":false,\\\"failCodeFormat\\\":1,\\\"failCode\\\":\\\"0000000000000000\\\",\\\"osdpID\\\":0,\\\"cardFormat\\\":0},\\\"channels\\\":[{\\\"index\\\":0,\\\"mode\\\":1,\\\"baudrate\\\":115200}]},\\\"authentication\\\":{\\\"matching_timeout\\\":\\\"5\\\",\\\"auth_timeout\\\":\\\"5\\\",\\\"enable_private_auth\\\":true,\\\"enable_server_matching\\\":false,\\\"face_detection_level\\\":\\\"0\\\",\\\"enable_full_access\\\":false,\\\"operation_modes\\\":[{\\\"mode\\\":0,\\\"schedule_id\\\":{\\\"id\\\":1},\\\"operators\\\":[],\\\"enable_card_Id_from_keypad\\\":false}]},\\\"card\\\":{\\\"use_csn\\\":true,\\\"use_mifare_felica\\\":true,\\\"use_em\\\":true,\\\"use_wiegand\\\":false,\\\"use_iclass\\\":false,\\\"use_HIDprox\\\":false,\\\"use_smart\\\":true,\\\"use_SEOS\\\":false,\\\"use_SR_SE\\\":false,\\\"use_desfire_ev1\\\":true,\\\"use_classic_plus\\\":true,\\\"use_mobile\\\":true,\\\"use_BLE\\\":false,\\\"use_NFC\\\":true,\\\"byte_order\\\":\\\"0\\\",\\\"use_wiegand_format\\\":false,\\\"card_layout\\\":{\\\"id\\\":\\\"2\\\"}},\\\"display\\\":{\\\"language\\\":\\\"1\\\",\\\"background\\\":\\\"0\\\",\\\"background_theme\\\":\\\"1\\\",\\\"volume\\\":\\\"50\\\",\\\"use_voice\\\":false,\\\"menu_timeout\\\":\\\"20\\\",\\\"message_timeout\\\":\\\"2000\\\",\\\"backlight_timeout\\\":\\\"20\\\",\\\"display_datetime\\\":true,\\\"date_type\\\":\\\"0\\\",\\\"time_format\\\":\\\"0\\\",\\\"home_formation\\\":\\\"5\\\",\\\"shortcut_home\\\":\\\"\\\",\\\"device_private_message\\\":false,\\\"server_private_message\\\":false,\\\"use_screen_saver\\\":false,\\\"sounds\\\":[]},\\\"system\\\":{\\\"timezone\\\":28800,\\\"sync_time\\\":true,\\\"locked\\\":false,\\\"interphone_type\\\":0,\\\"camera_frequency\\\":\\\"60\\\",\\\"use_alphanumeric\\\":false,\\\"enable_clear_on_tamper\\\":true,\\\"enable_data_encryption\\\":false,\\\"use_card_operation\\\":true},\\\"wiegand\\\":{\\\"wiegand_in_out\\\":\\\"0\\\",\\\"out_pulse_width\\\":\\\"40\\\",\\\"out_pulse_interval\\\":\\\"10000\\\",\\\"enable_bypass_mode\\\":false,\\\"format_id\\\":{\\\"id\\\":\\\"0\\\"},\\\"enable_fail_code\\\":false,\\\"fail_code\\\":\\\"0\\\",\\\"wiegand_output_info\\\":\\\"1\\\",\\\"wiegand_csn_id\\\":{\\\"id\\\":\\\"-1\\\"},\\\"wiegand_cards\\\":[],\\\"wiegand_inputs\\\":[]},\\\"tna\\\":{\\\"mode\\\":\\\"1\\\",\\\"fixed_code\\\":0,\\\"required\\\":false,\\\"tna_keys\\\":[{\\\"order\\\":1,\\\"key\\\":0,\\\"keyName\\\":\\\"Code 1\\\",\\\"schedule_id\\\":{},\\\"label\\\":\\\"\\\"}]},\\\"input\\\":{\\\"input_port_num\\\":\\\"0\\\",\\\"supervised_inputs\\\":\\\"\\\"},\\\"event_filter\\\":{\\\"rows\\\":[],\\\"total\\\":\\\"0\\\"},\\\"voip\\\":{\\\"use\\\":false,\\\"server\\\":{\\\"address\\\":\\\"\\\",\\\"user_id\\\":\\\"\\\",\\\"password\\\":\\\"\\\",\\\"port\\\":\\\"\\\"},\\\"dtmf\\\":{\\\"mode\\\":\\\"0\\\",\\\"exit_button\\\":\\\"0\\\"},\\\"phonebook_list\\\":[]},\\\"barcode\\\":{\\\"use_barcode\\\":false,\\\"scan_timeout\\\":\\\"4\\\"},\\\"pktversion\\\":\\\"3\\\",\\\"support_occupancy\\\":true,\\\"thermal_config\\\":{\\\"enable_thermal_camera\\\":\\\"0\\\",\\\"enable_centigrade\\\":\\\"1\\\",\\\"temperature_threshold_high\\\":\\\"3800\\\",\\\"enable_audit_temperature\\\":true,\\\"enable_temperature_reject_sound\\\":true,\\\"enable_overlap_thermal\\\":true,\\\"temperature_checkmode\\\":\\\"0\\\",\\\"enable_mask\\\":\\\"0\\\",\\\"mask_detection_level\\\":\\\"0\\\",\\\"enable_dynamic_roi\\\":false},\\\"thermal_camera_config\\\":{\\\"distance\\\":\\\"100\\\",\\\"emissivity\\\":\\\"98\\\",\\\"roi_x\\\":\\\"47\\\",\\\"roi_y\\\":\\\"45\\\",\\\"roi_width\\\":\\\"15\\\",\\\"roi_height\\\":\\\"10\\\",\\\"enable_body_compensation\\\":true,\\\"compensation_temperature\\\":\\\"0\\\"},\\\"trigger_actions\\\":\\\"\\\",\\\"authmode\\\":{\\\"id\\\":\\\"542353521\\\",\\\"extAuthModeSupported\\\":false,\\\"cardAuthSupported\\\":true,\\\"cardAuthMask\\\":\\\"0\\\",\\\"fingerprintAuthSupported\\\":true,\\\"fingerprintAuthMask\\\":\\\"0\\\",\\\"faceAuthSupported\\\":false,\\\"faceAuthMask\\\":\\\"990979\\\",\\\"idAuthSupported\\\":true,\\\"idAuthMask\\\":\\\"0\\\"},\\\"card_supported_from_device\\\":{\\\"mask\\\":\\\"2147483957\\\",\\\"em4100\\\":true,\\\"HIDProx\\\":false,\\\"mifare_felica\\\":true,\\\"iCLASS\\\":false,\\\"mifareClassic_Plus\\\":true,\\\"Desfire_ev1\\\":true,\\\"iCLASSSRSE\\\":false,\\\"iCLASSSEOS\\\":false,\\\"NFC\\\":true,\\\"BLE\\\":false,\\\"use_card_operation\\\":true},\\\"capability\\\":{\\\"thermalAuthSupported\\\":\\\"1\\\",\\\"maskAuthSupported\\\":\\\"0\\\",\\\"intelligentPDSupported\\\":\\\"0\\\"},\\\"imageLogEventInfo\\\":{\\\"imageLogEventItems\\\":[]},\\\"use_image_log\\\":false,\\\"dst1\\\":\\\"0\\\",\\\"dst2\\\":\\\"0\\\"}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Device\":{\"name\":\"FaceStation 2 542353521
            (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code
            1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Device": @{ @"name": @"FaceStation 2
            542353521 (192.168.1.23)", @"device_group_id": @{ @"id": @47,
            @"name": @"Suprema" }, @"lan": @{ @"connection_mode": @1,
            @"enable_dhcp": @NO, @"use_dns": @NO, @"ip": @"192.168.1.23",
            @"device_port": @51211, @"gateway": @"192.168.1.1", @"subnet_mask":
            @"255.255.255.0", @"server_port": @51212, @"server_ip":
            @"192.168.1.5" }, @"usb": @{ @"enable_usb": @NO,
            @"enable_usb_memory": @NO }, @"wlan": @{ @"enabled": @NO,
            @"operation_mode": @0, @"auth_type": @0, @"encryption_type": @0 },
            @"rs485": @{ @"mode": @3, @"intelligentInfo": @{ @"supportIConfig":
            @NO, @"useFailCode": @NO, @"failCodeFormat": @1, @"failCode":
            @"0000000000000000", @"osdpID": @0, @"cardFormat": @0 },
            @"channels": @[ @{ @"index": @0, @"mode": @1, @"baudrate": @115200 }
            ] }, @"authentication": @{ @"matching_timeout": @"5",
            @"auth_timeout": @"5", @"enable_private_auth": @YES,
            @"enable_server_matching": @NO, @"face_detection_level": @"0",
            @"enable_full_access": @NO, @"operation_modes": @[ @{ @"mode": @0,
            @"schedule_id": @{ @"id": @1 }, @"operators": @[  ],
            @"enable_card_Id_from_keypad": @NO } ] }, @"card": @{ @"use_csn":
            @YES, @"use_mifare_felica": @YES, @"use_em": @YES, @"use_wiegand":
            @NO, @"use_iclass": @NO, @"use_HIDprox": @NO, @"use_smart": @YES,
            @"use_SEOS": @NO, @"use_SR_SE": @NO, @"use_desfire_ev1": @YES,
            @"use_classic_plus": @YES, @"use_mobile": @YES, @"use_BLE": @NO,
            @"use_NFC": @YES, @"byte_order": @"0", @"use_wiegand_format": @NO,
            @"card_layout": @{ @"id": @"2" } }, @"display": @{ @"language":
            @"1", @"background": @"0", @"background_theme": @"1", @"volume":
            @"50", @"use_voice": @NO, @"menu_timeout": @"20",
            @"message_timeout": @"2000", @"backlight_timeout": @"20",
            @"display_datetime": @YES, @"date_type": @"0", @"time_format": @"0",
            @"home_formation": @"5", @"shortcut_home": @"",
            @"device_private_message": @NO, @"server_private_message": @NO,
            @"use_screen_saver": @NO, @"sounds": @[  ] }, @"system": @{
            @"timezone": @28800, @"sync_time": @YES, @"locked": @NO,
            @"interphone_type": @0, @"camera_frequency": @"60",
            @"use_alphanumeric": @NO, @"enable_clear_on_tamper": @YES,
            @"enable_data_encryption": @NO, @"use_card_operation": @YES },
            @"wiegand": @{ @"wiegand_in_out": @"0", @"out_pulse_width": @"40",
            @"out_pulse_interval": @"10000", @"enable_bypass_mode": @NO,
            @"format_id": @{ @"id": @"0" }, @"enable_fail_code": @NO,
            @"fail_code": @"0", @"wiegand_output_info": @"1", @"wiegand_csn_id":
            @{ @"id": @"-1" }, @"wiegand_cards": @[  ], @"wiegand_inputs": @[  ]
            }, @"tna": @{ @"mode": @"1", @"fixed_code": @0, @"required": @NO,
            @"tna_keys": @[ @{ @"order": @1, @"key": @0, @"keyName": @"Code 1",
            @"schedule_id": @{  }, @"label": @"" } ] }, @"input": @{
            @"input_port_num": @"0", @"supervised_inputs": @"" },
            @"event_filter": @{ @"rows": @[  ], @"total": @"0" }, @"voip": @{
            @"use": @NO, @"server": @{ @"address": @"", @"user_id": @"",
            @"password": @"", @"port": @"" }, @"dtmf": @{ @"mode": @"0",
            @"exit_button": @"0" }, @"phonebook_list": @[  ] }, @"barcode": @{
            @"use_barcode": @NO, @"scan_timeout": @"4" }, @"pktversion": @"3",
            @"support_occupancy": @YES, @"thermal_config": @{
            @"enable_thermal_camera": @"0", @"enable_centigrade": @"1",
            @"temperature_threshold_high": @"3800", @"enable_audit_temperature":
            @YES, @"enable_temperature_reject_sound": @YES,
            @"enable_overlap_thermal": @YES, @"temperature_checkmode": @"0",
            @"enable_mask": @"0", @"mask_detection_level": @"0",
            @"enable_dynamic_roi": @NO }, @"thermal_camera_config": @{
            @"distance": @"100", @"emissivity": @"98", @"roi_x": @"47",
            @"roi_y": @"45", @"roi_width": @"15", @"roi_height": @"10",
            @"enable_body_compensation": @YES, @"compensation_temperature": @"0"
            }, @"trigger_actions": @"", @"authmode": @{ @"id": @"542353521",
            @"extAuthModeSupported": @NO, @"cardAuthSupported": @YES,
            @"cardAuthMask": @"0", @"fingerprintAuthSupported": @YES,
            @"fingerprintAuthMask": @"0", @"faceAuthSupported": @NO,
            @"faceAuthMask": @"990979", @"idAuthSupported": @YES, @"idAuthMask":
            @"0" }, @"card_supported_from_device": @{ @"mask": @"2147483957",
            @"em4100": @YES, @"HIDProx": @NO, @"mifare_felica": @YES, @"iCLASS":
            @NO, @"mifareClassic_Plus": @YES, @"Desfire_ev1": @YES,
            @"iCLASSSRSE": @NO, @"iCLASSSEOS": @NO, @"NFC": @YES, @"BLE": @NO,
            @"use_card_operation": @YES }, @"capability": @{
            @"thermalAuthSupported": @"1", @"maskAuthSupported": @"0",
            @"intelligentPDSupported": @"0" }, @"imageLogEventInfo": @{
            @"imageLogEventItems": @[  ] }, @"use_image_log": @NO, @"dst1":
            @"0", @"dst2": @"0" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Device": [
                "name": "FaceStation 2 542353521 (192.168.1.23)",
                "device_group_id": [
                  "id": 47,
                  "name": "Suprema"
                ],
                "lan": [
                  "connection_mode": 1,
                  "enable_dhcp": false,
                  "use_dns": false,
                  "ip": "192.168.1.23",
                  "device_port": 51211,
                  "gateway": "192.168.1.1",
                  "subnet_mask": "255.255.255.0",
                  "server_port": 51212,
                  "server_ip": "192.168.1.5"
                ],
                "usb": [
                  "enable_usb": false,
                  "enable_usb_memory": false
                ],
                "wlan": [
                  "enabled": false,
                  "operation_mode": 0,
                  "auth_type": 0,
                  "encryption_type": 0
                ],
                "rs485": [
                  "mode": 3,
                  "intelligentInfo": [
                    "supportIConfig": false,
                    "useFailCode": false,
                    "failCodeFormat": 1,
                    "failCode": "0000000000000000",
                    "osdpID": 0,
                    "cardFormat": 0
                  ],
                  "channels": [
                    [
                      "index": 0,
                      "mode": 1,
                      "baudrate": 115200
                    ]
                  ]
                ],
                "authentication": [
                  "matching_timeout": "5",
                  "auth_timeout": "5",
                  "enable_private_auth": true,
                  "enable_server_matching": false,
                  "face_detection_level": "0",
                  "enable_full_access": false,
                  "operation_modes": [
                    [
                      "mode": 0,
                      "schedule_id": ["id": 1],
                      "operators": [],
                      "enable_card_Id_from_keypad": false
                    ]
                  ]
                ],
                "card": [
                  "use_csn": true,
                  "use_mifare_felica": true,
                  "use_em": true,
                  "use_wiegand": false,
                  "use_iclass": false,
                  "use_HIDprox": false,
                  "use_smart": true,
                  "use_SEOS": false,
                  "use_SR_SE": false,
                  "use_desfire_ev1": true,
                  "use_classic_plus": true,
                  "use_mobile": true,
                  "use_BLE": false,
                  "use_NFC": true,
                  "byte_order": "0",
                  "use_wiegand_format": false,
                  "card_layout": ["id": "2"]
                ],
                "display": [
                  "language": "1",
                  "background": "0",
                  "background_theme": "1",
                  "volume": "50",
                  "use_voice": false,
                  "menu_timeout": "20",
                  "message_timeout": "2000",
                  "backlight_timeout": "20",
                  "display_datetime": true,
                  "date_type": "0",
                  "time_format": "0",
                  "home_formation": "5",
                  "shortcut_home": "",
                  "device_private_message": false,
                  "server_private_message": false,
                  "use_screen_saver": false,
                  "sounds": []
                ],
                "system": [
                  "timezone": 28800,
                  "sync_time": true,
                  "locked": false,
                  "interphone_type": 0,
                  "camera_frequency": "60",
                  "use_alphanumeric": false,
                  "enable_clear_on_tamper": true,
                  "enable_data_encryption": false,
                  "use_card_operation": true
                ],
                "wiegand": [
                  "wiegand_in_out": "0",
                  "out_pulse_width": "40",
                  "out_pulse_interval": "10000",
                  "enable_bypass_mode": false,
                  "format_id": ["id": "0"],
                  "enable_fail_code": false,
                  "fail_code": "0",
                  "wiegand_output_info": "1",
                  "wiegand_csn_id": ["id": "-1"],
                  "wiegand_cards": [],
                  "wiegand_inputs": []
                ],
                "tna": [
                  "mode": "1",
                  "fixed_code": 0,
                  "required": false,
                  "tna_keys": [
                    [
                      "order": 1,
                      "key": 0,
                      "keyName": "Code 1",
                      "schedule_id": [],
                      "label": ""
                    ]
                  ]
                ],
                "input": [
                  "input_port_num": "0",
                  "supervised_inputs": ""
                ],
                "event_filter": [
                  "rows": [],
                  "total": "0"
                ],
                "voip": [
                  "use": false,
                  "server": [
                    "address": "",
                    "user_id": "",
                    "password": "",
                    "port": ""
                  ],
                  "dtmf": [
                    "mode": "0",
                    "exit_button": "0"
                  ],
                  "phonebook_list": []
                ],
                "barcode": [
                  "use_barcode": false,
                  "scan_timeout": "4"
                ],
                "pktversion": "3",
                "support_occupancy": true,
                "thermal_config": [
                  "enable_thermal_camera": "0",
                  "enable_centigrade": "1",
                  "temperature_threshold_high": "3800",
                  "enable_audit_temperature": true,
                  "enable_temperature_reject_sound": true,
                  "enable_overlap_thermal": true,
                  "temperature_checkmode": "0",
                  "enable_mask": "0",
                  "mask_detection_level": "0",
                  "enable_dynamic_roi": false
                ],
                "thermal_camera_config": [
                  "distance": "100",
                  "emissivity": "98",
                  "roi_x": "47",
                  "roi_y": "45",
                  "roi_width": "15",
                  "roi_height": "10",
                  "enable_body_compensation": true,
                  "compensation_temperature": "0"
                ],
                "trigger_actions": "",
                "authmode": [
                  "id": "542353521",
                  "extAuthModeSupported": false,
                  "cardAuthSupported": true,
                  "cardAuthMask": "0",
                  "fingerprintAuthSupported": true,
                  "fingerprintAuthMask": "0",
                  "faceAuthSupported": false,
                  "faceAuthMask": "990979",
                  "idAuthSupported": true,
                  "idAuthMask": "0"
                ],
                "card_supported_from_device": [
                  "mask": "2147483957",
                  "em4100": true,
                  "HIDProx": false,
                  "mifare_felica": true,
                  "iCLASS": false,
                  "mifareClassic_Plus": true,
                  "Desfire_ev1": true,
                  "iCLASSSRSE": false,
                  "iCLASSSEOS": false,
                  "NFC": true,
                  "BLE": false,
                  "use_card_operation": true
                ],
                "capability": [
                  "thermalAuthSupported": "1",
                  "maskAuthSupported": "0",
                  "intelligentPDSupported": "0"
                ],
                "imageLogEventInfo": ["imageLogEventItems": []],
                "use_image_log": false,
                "dst1": "0",
                "dst2": "0"
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/devices/{id}");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Device\":{\"name\":\"FaceStation 2 542353521
            (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code
            1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/devices/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Device\":{\"name\":\"FaceStation 2 542353521 (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code 1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/{id}' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"Device":{"name":"FaceStation 2 542353521
            (192.168.1.23)","device_group_id":{"id":47,"name":"Suprema"},"lan":{"connection_mode":1,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.23","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"usb":{"enable_usb":false,"enable_usb_memory":false},"wlan":{"enabled":false,"operation_mode":0,"auth_type":0,"encryption_type":0},"rs485":{"mode":3,"intelligentInfo":{"supportIConfig":false,"useFailCode":false,"failCodeFormat":1,"failCode":"0000000000000000","osdpID":0,"cardFormat":0},"channels":[{"index":0,"mode":1,"baudrate":115200}]},"authentication":{"matching_timeout":"5","auth_timeout":"5","enable_private_auth":true,"enable_server_matching":false,"face_detection_level":"0","enable_full_access":false,"operation_modes":[{"mode":0,"schedule_id":{"id":1},"operators":[],"enable_card_Id_from_keypad":false}]},"card":{"use_csn":true,"use_mifare_felica":true,"use_em":true,"use_wiegand":false,"use_iclass":false,"use_HIDprox":false,"use_smart":true,"use_SEOS":false,"use_SR_SE":false,"use_desfire_ev1":true,"use_classic_plus":true,"use_mobile":true,"use_BLE":false,"use_NFC":true,"byte_order":"0","use_wiegand_format":false,"card_layout":{"id":"2"}},"display":{"language":"1","background":"0","background_theme":"1","volume":"50","use_voice":false,"menu_timeout":"20","message_timeout":"2000","backlight_timeout":"20","display_datetime":true,"date_type":"0","time_format":"0","home_formation":"5","shortcut_home":"","device_private_message":false,"server_private_message":false,"use_screen_saver":false,"sounds":[]},"system":{"timezone":28800,"sync_time":true,"locked":false,"interphone_type":0,"camera_frequency":"60","use_alphanumeric":false,"enable_clear_on_tamper":true,"enable_data_encryption":false,"use_card_operation":true},"wiegand":{"wiegand_in_out":"0","out_pulse_width":"40","out_pulse_interval":"10000","enable_bypass_mode":false,"format_id":{"id":"0"},"enable_fail_code":false,"fail_code":"0","wiegand_output_info":"1","wiegand_csn_id":{"id":"-1"},"wiegand_cards":[],"wiegand_inputs":[]},"tna":{"mode":"1","fixed_code":0,"required":false,"tna_keys":[{"order":1,"key":0,"keyName":"Code
            1","schedule_id":{},"label":""}]},"input":{"input_port_num":"0","supervised_inputs":""},"event_filter":{"rows":[],"total":"0"},"voip":{"use":false,"server":{"address":"","user_id":"","password":"","port":""},"dtmf":{"mode":"0","exit_button":"0"},"phonebook_list":[]},"barcode":{"use_barcode":false,"scan_timeout":"4"},"pktversion":"3","support_occupancy":true,"thermal_config":{"enable_thermal_camera":"0","enable_centigrade":"1","temperature_threshold_high":"3800","enable_audit_temperature":true,"enable_temperature_reject_sound":true,"enable_overlap_thermal":true,"temperature_checkmode":"0","enable_mask":"0","mask_detection_level":"0","enable_dynamic_roi":false},"thermal_camera_config":{"distance":"100","emissivity":"98","roi_x":"47","roi_y":"45","roi_width":"15","roi_height":"10","enable_body_compensation":true,"compensation_temperature":"0"},"trigger_actions":"","authmode":{"id":"542353521","extAuthModeSupported":false,"cardAuthSupported":true,"cardAuthMask":"0","fingerprintAuthSupported":true,"fingerprintAuthMask":"0","faceAuthSupported":false,"faceAuthMask":"990979","idAuthSupported":true,"idAuthMask":"0"},"card_supported_from_device":{"mask":"2147483957","em4100":true,"HIDProx":false,"mifare_felica":true,"iCLASS":false,"mifareClassic_Plus":true,"Desfire_ev1":true,"iCLASSSRSE":false,"iCLASSSEOS":false,"NFC":true,"BLE":false,"use_card_operation":true},"capability":{"thermalAuthSupported":"1","maskAuthSupported":"0","intelligentPDSupported":"0"},"imageLogEventInfo":{"imageLogEventItems":[]},"use_image_log":false,"dst1":"0","dst2":"0"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/{id}' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"Device":{"name":"FaceStation 2 542353521
            (192.168.1.23)","device_group_id":{"id":47,"name":"Suprema"},"lan":{"connection_mode":1,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.23","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"usb":{"enable_usb":false,"enable_usb_memory":false},"wlan":{"enabled":false,"operation_mode":0,"auth_type":0,"encryption_type":0},"rs485":{"mode":3,"intelligentInfo":{"supportIConfig":false,"useFailCode":false,"failCodeFormat":1,"failCode":"0000000000000000","osdpID":0,"cardFormat":0},"channels":[{"index":0,"mode":1,"baudrate":115200}]},"authentication":{"matching_timeout":"5","auth_timeout":"5","enable_private_auth":true,"enable_server_matching":false,"face_detection_level":"0","enable_full_access":false,"operation_modes":[{"mode":0,"schedule_id":{"id":1},"operators":[],"enable_card_Id_from_keypad":false}]},"card":{"use_csn":true,"use_mifare_felica":true,"use_em":true,"use_wiegand":false,"use_iclass":false,"use_HIDprox":false,"use_smart":true,"use_SEOS":false,"use_SR_SE":false,"use_desfire_ev1":true,"use_classic_plus":true,"use_mobile":true,"use_BLE":false,"use_NFC":true,"byte_order":"0","use_wiegand_format":false,"card_layout":{"id":"2"}},"display":{"language":"1","background":"0","background_theme":"1","volume":"50","use_voice":false,"menu_timeout":"20","message_timeout":"2000","backlight_timeout":"20","display_datetime":true,"date_type":"0","time_format":"0","home_formation":"5","shortcut_home":"","device_private_message":false,"server_private_message":false,"use_screen_saver":false,"sounds":[]},"system":{"timezone":28800,"sync_time":true,"locked":false,"interphone_type":0,"camera_frequency":"60","use_alphanumeric":false,"enable_clear_on_tamper":true,"enable_data_encryption":false,"use_card_operation":true},"wiegand":{"wiegand_in_out":"0","out_pulse_width":"40","out_pulse_interval":"10000","enable_bypass_mode":false,"format_id":{"id":"0"},"enable_fail_code":false,"fail_code":"0","wiegand_output_info":"1","wiegand_csn_id":{"id":"-1"},"wiegand_cards":[],"wiegand_inputs":[]},"tna":{"mode":"1","fixed_code":0,"required":false,"tna_keys":[{"order":1,"key":0,"keyName":"Code
            1","schedule_id":{},"label":""}]},"input":{"input_port_num":"0","supervised_inputs":""},"event_filter":{"rows":[],"total":"0"},"voip":{"use":false,"server":{"address":"","user_id":"","password":"","port":""},"dtmf":{"mode":"0","exit_button":"0"},"phonebook_list":[]},"barcode":{"use_barcode":false,"scan_timeout":"4"},"pktversion":"3","support_occupancy":true,"thermal_config":{"enable_thermal_camera":"0","enable_centigrade":"1","temperature_threshold_high":"3800","enable_audit_temperature":true,"enable_temperature_reject_sound":true,"enable_overlap_thermal":true,"temperature_checkmode":"0","enable_mask":"0","mask_detection_level":"0","enable_dynamic_roi":false},"thermal_camera_config":{"distance":"100","emissivity":"98","roi_x":"47","roi_y":"45","roi_width":"15","roi_height":"10","enable_body_compensation":true,"compensation_temperature":"0"},"trigger_actions":"","authmode":{"id":"542353521","extAuthModeSupported":false,"cardAuthSupported":true,"cardAuthMask":"0","fingerprintAuthSupported":true,"fingerprintAuthMask":"0","faceAuthSupported":false,"faceAuthMask":"990979","idAuthSupported":true,"idAuthMask":"0"},"card_supported_from_device":{"mask":"2147483957","em4100":true,"HIDProx":false,"mifare_felica":true,"iCLASS":false,"mifareClassic_Plus":true,"Desfire_ev1":true,"iCLASSSRSE":false,"iCLASSSEOS":false,"NFC":true,"BLE":false,"use_card_operation":true},"capability":{"thermalAuthSupported":"1","maskAuthSupported":"0","intelligentPDSupported":"0"},"imageLogEventInfo":{"imageLogEventItems":[]},"use_image_log":false,"dst1":"0","dst2":"0"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/{id}"


            payload <- "{\"Device\":{\"name\":\"FaceStation 2 542353521
            (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code
            1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices/{id}" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Device\":{\"name\":\"FaceStation 2 542353521
            (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code
            1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Device\":{\"name\":\"FaceStation 2 542353521
            (192.168.1.23)\",\"device_group_id\":{\"id\":47,\"name\":\"Suprema\"},\"lan\":{\"connection_mode\":1,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.23\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"usb\":{\"enable_usb\":false,\"enable_usb_memory\":false},\"wlan\":{\"enabled\":false,\"operation_mode\":0,\"auth_type\":0,\"encryption_type\":0},\"rs485\":{\"mode\":3,\"intelligentInfo\":{\"supportIConfig\":false,\"useFailCode\":false,\"failCodeFormat\":1,\"failCode\":\"0000000000000000\",\"osdpID\":0,\"cardFormat\":0},\"channels\":[{\"index\":0,\"mode\":1,\"baudrate\":115200}]},\"authentication\":{\"matching_timeout\":\"5\",\"auth_timeout\":\"5\",\"enable_private_auth\":true,\"enable_server_matching\":false,\"face_detection_level\":\"0\",\"enable_full_access\":false,\"operation_modes\":[{\"mode\":0,\"schedule_id\":{\"id\":1},\"operators\":[],\"enable_card_Id_from_keypad\":false}]},\"card\":{\"use_csn\":true,\"use_mifare_felica\":true,\"use_em\":true,\"use_wiegand\":false,\"use_iclass\":false,\"use_HIDprox\":false,\"use_smart\":true,\"use_SEOS\":false,\"use_SR_SE\":false,\"use_desfire_ev1\":true,\"use_classic_plus\":true,\"use_mobile\":true,\"use_BLE\":false,\"use_NFC\":true,\"byte_order\":\"0\",\"use_wiegand_format\":false,\"card_layout\":{\"id\":\"2\"}},\"display\":{\"language\":\"1\",\"background\":\"0\",\"background_theme\":\"1\",\"volume\":\"50\",\"use_voice\":false,\"menu_timeout\":\"20\",\"message_timeout\":\"2000\",\"backlight_timeout\":\"20\",\"display_datetime\":true,\"date_type\":\"0\",\"time_format\":\"0\",\"home_formation\":\"5\",\"shortcut_home\":\"\",\"device_private_message\":false,\"server_private_message\":false,\"use_screen_saver\":false,\"sounds\":[]},\"system\":{\"timezone\":28800,\"sync_time\":true,\"locked\":false,\"interphone_type\":0,\"camera_frequency\":\"60\",\"use_alphanumeric\":false,\"enable_clear_on_tamper\":true,\"enable_data_encryption\":false,\"use_card_operation\":true},\"wiegand\":{\"wiegand_in_out\":\"0\",\"out_pulse_width\":\"40\",\"out_pulse_interval\":\"10000\",\"enable_bypass_mode\":false,\"format_id\":{\"id\":\"0\"},\"enable_fail_code\":false,\"fail_code\":\"0\",\"wiegand_output_info\":\"1\",\"wiegand_csn_id\":{\"id\":\"-1\"},\"wiegand_cards\":[],\"wiegand_inputs\":[]},\"tna\":{\"mode\":\"1\",\"fixed_code\":0,\"required\":false,\"tna_keys\":[{\"order\":1,\"key\":0,\"keyName\":\"Code
            1\",\"schedule_id\":{},\"label\":\"\"}]},\"input\":{\"input_port_num\":\"0\",\"supervised_inputs\":\"\"},\"event_filter\":{\"rows\":[],\"total\":\"0\"},\"voip\":{\"use\":false,\"server\":{\"address\":\"\",\"user_id\":\"\",\"password\":\"\",\"port\":\"\"},\"dtmf\":{\"mode\":\"0\",\"exit_button\":\"0\"},\"phonebook_list\":[]},\"barcode\":{\"use_barcode\":false,\"scan_timeout\":\"4\"},\"pktversion\":\"3\",\"support_occupancy\":true,\"thermal_config\":{\"enable_thermal_camera\":\"0\",\"enable_centigrade\":\"1\",\"temperature_threshold_high\":\"3800\",\"enable_audit_temperature\":true,\"enable_temperature_reject_sound\":true,\"enable_overlap_thermal\":true,\"temperature_checkmode\":\"0\",\"enable_mask\":\"0\",\"mask_detection_level\":\"0\",\"enable_dynamic_roi\":false},\"thermal_camera_config\":{\"distance\":\"100\",\"emissivity\":\"98\",\"roi_x\":\"47\",\"roi_y\":\"45\",\"roi_width\":\"15\",\"roi_height\":\"10\",\"enable_body_compensation\":true,\"compensation_temperature\":\"0\"},\"trigger_actions\":\"\",\"authmode\":{\"id\":\"542353521\",\"extAuthModeSupported\":false,\"cardAuthSupported\":true,\"cardAuthMask\":\"0\",\"fingerprintAuthSupported\":true,\"fingerprintAuthMask\":\"0\",\"faceAuthSupported\":false,\"faceAuthMask\":\"990979\",\"idAuthSupported\":true,\"idAuthMask\":\"0\"},\"card_supported_from_device\":{\"mask\":\"2147483957\",\"em4100\":true,\"HIDProx\":false,\"mifare_felica\":true,\"iCLASS\":false,\"mifareClassic_Plus\":true,\"Desfire_ev1\":true,\"iCLASSSRSE\":false,\"iCLASSSEOS\":false,\"NFC\":true,\"BLE\":false,\"use_card_operation\":true},\"capability\":{\"thermalAuthSupported\":\"1\",\"maskAuthSupported\":\"0\",\"intelligentPDSupported\":\"0\"},\"imageLogEventInfo\":{\"imageLogEventItems\":[]},\"use_image_log\":false,\"dst1\":\"0\",\"dst2\":\"0\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Device
      summary: View Device Information
      operationId: viewDeviceInformation
      description: This API is used to view device's information.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device which information will be viewed
          example: 542353521
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/devices/542353521 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/devices/542353521 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices/542353521
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/542353521",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/542353521',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/devices/542353521");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/542353521',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices/542353521';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/542353521', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/542353521",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/devices/542353521");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/devices/542353521",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices/542353521"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/542353521")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/542353521",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/devices/542353521');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/devices/542353521');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/542353521")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/devices/542353521")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/542353521\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/542353521");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/542353521"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/542353521")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/542353521");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/devices/542353521"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/542353521' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/542353521' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/542353521"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices/542353521" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/542353521")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/resources/update:
    post:
      tags:
        - Device
      summary: Update Device Homescreen
      operationId: createResourcesUpdate
      description: >-
        Updates the homescreen display resources for one or more BioStar X
        devices.

        This API allows you to customize the device display with custom images,
        logos, or notices that appear on the device's homescreen.


        **Prerequisites**

        Before using this API, you must first configure the device's display
        settings using the Update Device API (`/api/devices/{id}`) with the
        following parameters:

        - `background`: Display mode (`0`=Default, `2`=Slide Show)

        - `background_theme`: Content type (`0`=Normal, `1`=Notice, `2`=Logo)

         ``` json

        {
          "Device": {
            "display": {
              "background": "0"
              "background_theme": "2"
            }
          }
        }

        ```

        For Slide Show mode, set both `background` and `background_theme` to
        "2".
      requestBody:
        required: true
        description: Device collection and resource data for updating homescreen display
        content:
          application/json:
            schema:
              type: object
              description: Request payload for updating device homescreen resources
              required:
                - DeviceCollection
                - ResourceDataCollection
              properties:
                DeviceCollection:
                  type: object
                  description: Collection of devices to update
                  required:
                    - total
                    - rows
                  properties:
                    total:
                      type: integer
                      description: Total number of devices which will be updated.
                      example: 2
                    rows:
                      type: array
                      description: Array of device objects to update
                      minItems: 1
                      items:
                        type: object
                        required:
                          - id
                        properties:
                          id:
                            type: string
                            description: >-
                              ID of the device which will be updated. May
                              contain multiple value by repeating the parameter
                              separated by comma (,). Do note that total number
                              of device need to be the same as total number of
                              device listed.
                            example: '538152248'
                ResourceDataCollection:
                  type: object
                  description: Collection of resource data to apply to devices
                  required:
                    - total
                    - type
                    - rows
                  properties:
                    total:
                      type: integer
                      description: Total number of data which will be applied.
                      example: 1
                    type:
                      type: string
                      description: |-
                        Resource type for homescreen display
                        - `1` = Use this if background_theme is set to Notice.
                        - `2` = Use this if background_theme is set to Logo.
                        - `3` = Use this to set it as Logo Slide Show.
                      enum:
                        - '1'
                        - '2'
                        - '3'
                      example: '2'
                    rows:
                      type: array
                      description: Array of resource data objects
                      minItems: 1
                      items:
                        type: object
                        required:
                          - slot
                          - data
                        properties:
                          slot:
                            type: integer
                            description: >-
                              Data display sequence. For Type 1 and 2 set it as
                              0.
                            example: 0
                          data:
                            type: string
                            description: >-
                              Data which will be used for homescreen display.
                              Use base64 encoding for its value.
                            example: iVBORw0KGgoAAAANSUhEUgAAAtAAAA...
            example:
              DeviceCollection:
                total: 2
                rows:
                  - id: '538152248'
                  - id: '538152254'
              ResourceDataCollection:
                total: 1
                type: '2'
                rows:
                  - slot: 0
                    data: iVBORw0KGgoAAAANSUhEUgAAAtAAAALg8gAAAABJRU5ErkJggg==
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/resources/update \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DeviceCollection":{"total":2,"rows":[{"id":"538152248"}]},"ResourceDataCollection":{"total":1,"type":"2","rows":[{"slot":0,"data":"iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"DeviceCollection":{"total":2,"rows":[{"id":"538152248"}]},"ResourceDataCollection":{"total":1,"type":"2","rows":[{"slot":0,"data":"iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."}]}}'
            |  \
              http POST https://{baseurl}/api/resources/update \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DeviceCollection":{"total":2,"rows":[{"id":"538152248"}]},"ResourceDataCollection":{"total":1,"type":"2","rows":[{"slot":0,"data":"iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."}]}}' \
              --output-document \
              - https://{baseurl}/api/resources/update
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/resources/update",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              DeviceCollection: {total: 2, rows: [{id: '538152248'}]},
              ResourceDataCollection: {
                total: 1,
                type: '2',
                rows: [{slot: 0, data: 'iVBORw0KGgoAAAANSUhEUgAAAtAAAA...'}]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/resources/update',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                DeviceCollection: {total: 2, rows: [{id: '538152248'}]},
                ResourceDataCollection: {
                  total: 1,
                  type: '2',
                  rows: [{slot: 0, data: 'iVBORw0KGgoAAAANSUhEUgAAAtAAAA...'}]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/resources/update");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "DeviceCollection": {
                "total": 2,
                "rows": [
                  {
                    "id": "538152248"
                  }
                ]
              },
              "ResourceDataCollection": {
                "total": 1,
                "type": "2",
                "rows": [
                  {
                    "slot": 0,
                    "data": "iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/resources/update',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                DeviceCollection: {total: 2, rows: [{id: '538152248'}]},
                ResourceDataCollection: {
                  total: 1,
                  type: '2',
                  rows: [{slot: 0, data: 'iVBORw0KGgoAAAANSUhEUgAAAtAAAA...'}]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/resources/update';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"total":2,"rows":[{"id":"538152248"}]},"ResourceDataCollection":{"total":1,"type":"2","rows":[{"slot":0,"data":"iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"total":2,"rows":[{"id":"538152248"}]},"ResourceDataCollection":{"total":1,"type":"2","rows":[{"slot":0,"data":"iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."}]}}'
            };

            fetch('https://{baseurl}/api/resources/update', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/resources/update",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DeviceCollection": {
                "total": 2,
                "rows": [
                  {
                    "id": "538152248"
                  }
                ]
              },
              "ResourceDataCollection": {
                "total": 1,
                "type": "2",
                "rows": [
                  {
                    "slot": 0,
                    "data": "iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/resources/update");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/resources/update", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/resources/update"


            payload = {
                "DeviceCollection": {
                    "total": 2,
                    "rows": [{"id": "538152248"}]
                },
                "ResourceDataCollection": {
                    "total": 1,
                    "type": "2",
                    "rows": [
                        {
                            "slot": 0,
                            "data": "iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."
                        }
                    ]
                }
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/resources/update")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/resources/update",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/resources/update');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"DeviceCollection":{"total":2,"rows":[{"id":"538152248"}]},"ResourceDataCollection":{"total":1,"type":"2","rows":[{"slot":0,"data":"iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"DeviceCollection":{"total":2,"rows":[{"id":"538152248"}]},"ResourceDataCollection":{"total":1,"type":"2","rows":[{"slot":0,"data":"iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."}]}}');


            $request->setRequestUrl('https://{baseurl}/api/resources/update');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/resources/update")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/resources/update")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/resources/update\"\n\n\tpayload := strings.NewReader(\"{\\\"DeviceCollection\\\":{\\\"total\\\":2,\\\"rows\\\":[{\\\"id\\\":\\\"538152248\\\"}]},\\\"ResourceDataCollection\\\":{\\\"total\\\":1,\\\"type\\\":\\\"2\\\",\\\"rows\\\":[{\\\"slot\\\":0,\\\"data\\\":\\\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\\\"}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/resources/update");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DeviceCollection": @{ @"total": @2,
            @"rows": @[ @{ @"id": @"538152248" } ] },
                                          @"ResourceDataCollection": @{ @"total": @1, @"type": @"2", @"rows": @[ @{ @"slot": @0, @"data": @"iVBORw0KGgoAAAANSUhEUgAAAtAAAA..." } ] } };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/resources/update"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "DeviceCollection": [
                "total": 2,
                "rows": [["id": "538152248"]]
              ],
              "ResourceDataCollection": [
                "total": 1,
                "type": "2",
                "rows": [
                  [
                    "slot": 0,
                    "data": "iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."
                  ]
                ]
              ]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/resources/update")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/resources/update");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/resources/update"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/resources/update' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"total":2,"rows":[{"id":"538152248"}]},"ResourceDataCollection":{"total":1,"type":"2","rows":[{"slot":0,"data":"iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/resources/update' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"total":2,"rows":[{"id":"538152248"}]},"ResourceDataCollection":{"total":1,"type":"2","rows":[{"slot":0,"data":"iVBORw0KGgoAAAANSUhEUgAAAtAAAA..."}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/resources/update"


            payload <-
            "{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/resources/update" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"total\":2,\"rows\":[{\"id\":\"538152248\"}]},\"ResourceDataCollection\":{\"total\":1,\"type\":\"2\",\"rows\":[{\"slot\":0,\"data\":\"iVBORw0KGgoAAAANSUhEUgAAAtAAAA...\"}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/resources/update")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/device_types:
    get:
      tags:
        - Device
      summary: List Device Types
      operationId: listDeviceTypes
      description: This API is used to list Suprema devices recorded on BioStar X.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/device_types \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/device_types \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/device_types
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/device_types",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/device_types',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/device_types");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/device_types',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/device_types';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/device_types', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/device_types",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/device_types");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/device_types", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/device_types"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/device_types")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/device_types",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/device_types');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/device_types');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/device_types")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/device_types")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/device_types\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/device_types");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/device_types"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/device_types")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/device_types");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/device_types"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/device_types' -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/device_types' -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/device_types"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/device_types" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/device_types")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/enrollment:
    get:
      tags:
        - Device
      summary: View Device(s) Based on Enrollment Type
      operationId: getDeviceEnrollment
      description: This API is used to view device(s) based on its enrollment capabilities.
      parameters:
        - name: type
          in: query
          schema:
            type: integer
          description: >-
            Device enrollment type. `0`=All, `1`=Finger, `2`=CSN, `3`= Smart,
            `4`=Face, `5`=Visual Face
          example: 0
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/devices/enrollment?type=0' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET 'https://{baseurl}/api/devices/enrollment?type=0' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/devices/enrollment?type=0'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/enrollment?type=0",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/enrollment',
              qs: {type: '0'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/devices/enrollment");


            req.query({
              "type": "0"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/enrollment',
              params: {type: '0'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices/enrollment?type=0';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/enrollment?type=0', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/enrollment?type=0",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/devices/enrollment?type=0");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/devices/enrollment?type=0",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/enrollment"


            querystring = {"type":"0"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/enrollment?type=0")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/enrollment?type=0",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/devices/enrollment');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'type' => '0'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/devices/enrollment');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'type' => '0'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/enrollment?type=0")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/devices/enrollment?type=0")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/enrollment?type=0\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/enrollment?type=0");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/enrollment?type=0"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/enrollment?type=0")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/enrollment?type=0");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/devices/enrollment?type=0"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/enrollment?type=0' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/enrollment?type=0' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/enrollment"


            queryString <- list([ 'type' ] = "0")


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/enrollment?type=0" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/enrollment?type=0")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/devices/search:
    post:
      tags:
        - Device
      summary: List Added Device(s) with Criteria
      operationId: searchDeviceSearch
      description: |-
        This API is used to list devices with parameters to filter the result.
        It is required to at least put {} for the API to run correctly.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: >-
                    Limit the number of responses according to the specified
                    value
                  example: 0
                exclude_device_type_id:
                  type: integer
                  description: >-
                    Exclude device to show on the response according to the
                    device type id specified
                  example: 254
                order_by:
                  type: string
                  description: Order the response according to the specified value
                  example: id:false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: >-
                      Connection status of the device. `0`= Disconnected, `1`=
                      Connected, `2`= Sync Error
                    example: 1
                  user_sync_status:
                    type: integer
                    description: >-
                      User sync status of the device. `-1`= Exceeded max user
                      count, `0`= Normal, `>0`= User Sync Error
                    example: 0
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/devices/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"limit":0,"exclude_device_type_id":254,"order_by":"id:false"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"limit":0,"exclude_device_type_id":254,"order_by":"id:false"}' | 
            \
              http POST https://{baseurl}/api/v2/devices/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"limit":0,"exclude_device_type_id":254,"order_by":"id:false"}' \
              --output-document \
              - https://{baseurl}/api/v2/devices/search
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/devices/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({limit: 0, exclude_device_type_id: 254,
            order_by: 'id:false'}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/devices/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {limit: 0, exclude_device_type_id: 254, order_by: 'id:false'},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/devices/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "limit": 0,
              "exclude_device_type_id": 254,
              "order_by": "id:false"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/devices/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {limit: 0, exclude_device_type_id: 254, order_by: 'id:false'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/devices/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":0,"exclude_device_type_id":254,"order_by":"id:false"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":0,"exclude_device_type_id":254,"order_by":"id:false"}'
            };

            fetch('https://{baseurl}/api/v2/devices/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/devices/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "limit": 0,
              "exclude_device_type_id": 254,
              "order_by": "id:false"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/devices/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/devices/search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/devices/search"


            payload = {
                "limit": 0,
                "exclude_device_type_id": 254,
                "order_by": "id:false"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/devices/search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/devices/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/devices/search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"limit":0,"exclude_device_type_id":254,"order_by":"id:false"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"limit":0,"exclude_device_type_id":254,"order_by":"id:false"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/devices/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/devices/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/devices/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/devices/search\"\n\n\tpayload := strings.NewReader(\"{\\\"limit\\\":0,\\\"exclude_device_type_id\\\":254,\\\"order_by\\\":\\\"id:false\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/devices/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"limit": @0,
                                          @"exclude_device_type_id": @254,
                                          @"order_by": @"id:false" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/devices/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "limit": 0,
              "exclude_device_type_id": 254,
              "order_by": "id:false"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/devices/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/devices/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/devices/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/devices/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"limit":0,"exclude_device_type_id":254,"order_by":"id:false"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/devices/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"limit":0,"exclude_device_type_id":254,"order_by":"id:false"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/devices/search"


            payload <-
            "{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/devices/search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"limit\":0,\"exclude_device_type_id\":254,\"order_by\":\"id:false\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/devices/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{id}/config:
    get:
      tags:
        - Device
      summary: View Device Configuration
      operationId: getDeviceConfig
      description: This API is used to view device's configuration.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device which information will be viewed
          example: 543720368
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/devices/543720368/config \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/devices/543720368/config \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices/543720368/config
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/543720368/config",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/543720368/config',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/devices/543720368/config");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/543720368/config',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices/543720368/config';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/543720368/config', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/543720368/config",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/devices/543720368/config");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/devices/543720368/config",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices/543720368/config"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/543720368/config")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/543720368/config",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/devices/543720368/config');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/543720368/config');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/543720368/config")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/devices/543720368/config")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/543720368/config\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/543720368/config");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/543720368/config"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/543720368/config")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/543720368/config");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/devices/543720368/config"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/543720368/config' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/543720368/config' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/543720368/config"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/543720368/config" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/543720368/config")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{id}/discover_userdata:
    get:
      tags:
        - Device
      summary: View User Statistics in a Device
      operationId: getDeviceDiscoverUserdata
      description: This API is used to view user statistics in a device.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device which will be viewed
          example: 538152248
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/devices/538152248/discover_userdata \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/devices/538152248/discover_userdata \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices/538152248/discover_userdata
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/538152248/discover_userdata",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/538152248/discover_userdata',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/devices/538152248/discover_userdata");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/538152248/discover_userdata',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/devices/538152248/discover_userdata';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/538152248/discover_userdata',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/538152248/discover_userdata",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/devices/538152248/discover_userdata");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/devices/538152248/discover_userdata",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices/538152248/discover_userdata"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/devices/538152248/discover_userdata")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/538152248/discover_userdata",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/538152248/discover_userdata');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/538152248/discover_userdata');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/538152248/discover_userdata")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/devices/538152248/discover_userdata")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/538152248/discover_userdata\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/538152248/discover_userdata");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/538152248/discover_userdata"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/538152248/discover_userdata")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/538152248/discover_userdata");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/devices/538152248/discover_userdata"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/538152248/discover_userdata' -Method
            GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/538152248/discover_userdata' -Method
            GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/538152248/discover_userdata"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/538152248/discover_userdata" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/538152248/discover_userdata")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/capability:
    post:
      tags:
        - Device
      summary: View Device Capabilities
      operationId: createDeviceCapability
      description: >-
        This API is used to list device's capabilities such as fingerprint,
        wifi, etc.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DeviceCollection:
                  $ref: '#/components/schemas/DeviceCollectionID'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/capability \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"DeviceCollection":{"rows":[{"id":544140034}]}}' |  \
              http POST https://{baseurl}/api/devices/capability \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DeviceCollection":{"rows":[{"id":544140034}]}}' \
              --output-document \
              - https://{baseurl}/api/devices/capability
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/capability",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({DeviceCollection: {rows: [{id:
            544140034}]}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/capability',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DeviceCollection: {rows: [{id: 544140034}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/capability");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": 544140034
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/capability',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DeviceCollection: {rows: [{id: 544140034}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/devices/capability';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
            };

            fetch('https://{baseurl}/api/devices/capability', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/capability",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": 544140034
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/devices/capability");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/devices/capability", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/capability"


            payload = {"DeviceCollection": {"rows": [{"id": 544140034}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/devices/capability")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/capability",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/capability');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"DeviceCollection":{"rows":[{"id":544140034}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"DeviceCollection":{"rows":[{"id":544140034}]}}');

            $request->setRequestUrl('https://{baseurl}/api/devices/capability');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/capability")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/capability")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/capability\"\n\n\tpayload := strings.NewReader(\"{\\\"DeviceCollection\\\":{\\\"rows\\\":[{\\\"id\\\":544140034}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/capability");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DeviceCollection": @{ @"rows": @[ @{
            @"id": @544140034 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/capability"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DeviceCollection": ["rows": [["id": 544140034]]]]
            as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/capability")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/capability");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/capability"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/capability' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/capability' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/capability"


            payload <- "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices/capability"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/capability")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/sync:
    post:
      tags:
        - Device
      summary: Sync Device Data
      operationId: createDeviceSync
      description: This API is used to sync device's data with BioStar X.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DeviceCollection:
                  $ref: '#/components/schemas/DeviceCollectionID'
      parameters:
        - name: clean
          in: query
          schema:
            type: boolean
          description: Toggle true to delete data on the device before sync process.
          example: false
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/devices/sync?clean=false' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"DeviceCollection":{"rows":[{"id":544140034}]}}' |  \
              http POST 'https://{baseurl}/api/devices/sync?clean=false' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DeviceCollection":{"rows":[{"id":544140034}]}}' \
              --output-document \
              - 'https://{baseurl}/api/devices/sync?clean=false'
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/sync?clean=false",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({DeviceCollection: {rows: [{id:
            544140034}]}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/sync',
              qs: {clean: 'false'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DeviceCollection: {rows: [{id: 544140034}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/devices/sync");

            req.query({
              "clean": "false"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": 544140034
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/sync',
              params: {clean: 'false'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DeviceCollection: {rows: [{id: 544140034}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/devices/sync?clean=false';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
            };

            fetch('https://{baseurl}/api/devices/sync?clean=false', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/sync?clean=false",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": 544140034
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/devices/sync?clean=false");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/devices/sync?clean=false",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/sync"


            querystring = {"clean":"false"}


            payload = {"DeviceCollection": {"rows": [{"id": 544140034}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/devices/sync?clean=false")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/sync?clean=false",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/sync');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'clean' => 'false'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"DeviceCollection":{"rows":[{"id":544140034}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"DeviceCollection":{"rows":[{"id":544140034}]}}');

            $request->setRequestUrl('https://{baseurl}/api/devices/sync');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setQuery(new http\QueryString([
              'clean' => 'false'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/sync?clean=false")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/sync?clean=false")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/sync?clean=false\"\n\n\tpayload := strings.NewReader(\"{\\\"DeviceCollection\\\":{\\\"rows\\\":[{\\\"id\\\":544140034}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/sync?clean=false");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DeviceCollection": @{ @"rows": @[ @{
            @"id": @544140034 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/sync?clean=false"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DeviceCollection": ["rows": [["id": 544140034]]]]
            as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/sync?clean=false")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/sync?clean=false");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/sync?clean=false"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/sync?clean=false' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/sync?clean=false' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/sync"


            queryString <- list([ 'clean' ] = "false")


            payload <- "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/sync?clean=false" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/sync?clean=false")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/unlock:
    post:
      tags:
        - Device
      summary: Unlock Device
      operationId: createDeviceUnlock
      description: |-
        This API is used to set a device state to unlocked.

        Manually unlocked device state will persist until it's normalized.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DeviceCollection:
                  $ref: '#/components/schemas/DeviceCollectionID'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/unlock \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"DeviceCollection":{"rows":[{"id":544140034}]}}' |  \
              http POST https://{baseurl}/api/devices/unlock \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DeviceCollection":{"rows":[{"id":544140034}]}}' \
              --output-document \
              - https://{baseurl}/api/devices/unlock
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/unlock",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({DeviceCollection: {rows: [{id:
            544140034}]}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/unlock',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DeviceCollection: {rows: [{id: 544140034}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/devices/unlock");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": 544140034
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/unlock',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DeviceCollection: {rows: [{id: 544140034}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/devices/unlock';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
            };

            fetch('https://{baseurl}/api/devices/unlock', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/unlock",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": 544140034
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/devices/unlock");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/devices/unlock", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/unlock"


            payload = {"DeviceCollection": {"rows": [{"id": 544140034}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/devices/unlock")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/unlock",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/unlock');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"DeviceCollection":{"rows":[{"id":544140034}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"DeviceCollection":{"rows":[{"id":544140034}]}}');

            $request->setRequestUrl('https://{baseurl}/api/devices/unlock');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/unlock")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/unlock")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/unlock\"\n\n\tpayload := strings.NewReader(\"{\\\"DeviceCollection\\\":{\\\"rows\\\":[{\\\"id\\\":544140034}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/unlock");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DeviceCollection": @{ @"rows": @[ @{
            @"id": @544140034 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/unlock"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DeviceCollection": ["rows": [["id": 544140034]]]]
            as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/unlock")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/devices/unlock");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/unlock"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/unlock' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/unlock' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":544140034}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/unlock"


            payload <- "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices/unlock" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":544140034}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/unlock")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/tcp_search:
    post:
      tags:
        - Device
      summary: Search Devices (TCP)
      operationId: searchDeviceTcpSearch
      description: |-
        This API is used to view device's information using TCP.


        This API only works for devices which haven't been added to BioStar X.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Device:
                  type: object
                  properties:
                    lan:
                      type: object
                      required:
                        - ip
                        - device_port
                      properties:
                        ip:
                          type: string
                          description: IP of the device
                          example: 192.168.1.25
                        device_port:
                          type: integer
                          description: Port of the device
                          example: 51211
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/tcp_search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Device":{"lan":{"ip":"192.168.1.25","device_port":51211}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"Device":{"lan":{"ip":"192.168.1.25","device_port":51211}}}'
            |  \
              http POST https://{baseurl}/api/devices/tcp_search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Device":{"lan":{"ip":"192.168.1.25","device_port":51211}}}' \
              --output-document \
              - https://{baseurl}/api/devices/tcp_search
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/tcp_search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({Device: {lan: {ip: '192.168.1.25',
            device_port: 51211}}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/tcp_search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {Device: {lan: {ip: '192.168.1.25', device_port: 51211}}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/tcp_search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "Device": {
                "lan": {
                  "ip": "192.168.1.25",
                  "device_port": 51211
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/tcp_search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {Device: {lan: {ip: '192.168.1.25', device_port: 51211}}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/devices/tcp_search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Device":{"lan":{"ip":"192.168.1.25","device_port":51211}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Device":{"lan":{"ip":"192.168.1.25","device_port":51211}}}'
            };

            fetch('https://{baseurl}/api/devices/tcp_search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/tcp_search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Device": {
                "lan": {
                  "ip": "192.168.1.25",
                  "device_port": 51211
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/devices/tcp_search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/devices/tcp_search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/tcp_search"


            payload = {"Device": {"lan": {
                        "ip": "192.168.1.25",
                        "device_port": 51211
                    }}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/devices/tcp_search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/tcp_search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/tcp_search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Device":{"lan":{"ip":"192.168.1.25","device_port":51211}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Device":{"lan":{"ip":"192.168.1.25","device_port":51211}}}');


            $request->setRequestUrl('https://{baseurl}/api/devices/tcp_search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/tcp_search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/tcp_search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/tcp_search\"\n\n\tpayload := strings.NewReader(\"{\\\"Device\\\":{\\\"lan\\\":{\\\"ip\\\":\\\"192.168.1.25\\\",\\\"device_port\\\":51211}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/tcp_search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Device": @{ @"lan": @{ @"ip":
            @"192.168.1.25", @"device_port": @51211 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/tcp_search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Device": ["lan": [
                  "ip": "192.168.1.25",
                  "device_port": 51211
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/tcp_search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/tcp_search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/tcp_search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/tcp_search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Device":{"lan":{"ip":"192.168.1.25","device_port":51211}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/tcp_search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Device":{"lan":{"ip":"192.168.1.25","device_port":51211}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/tcp_search"


            payload <-
            "{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices/tcp_search"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Device\":{\"lan\":{\"ip\":\"192.168.1.25\",\"device_port\":51211}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/tcp_search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/udp_search:
    post:
      tags:
        - Device
      summary: Search Devices (UDP)
      operationId: searchDeviceUdpSearch
      description: This API is used to search devices through UDP.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                UdpSearchOption:
                  type: object
                  properties:
                    timeout:
                      type: integer
                      description: Search devices until the specified second reached
                      example: 3
                    with_rs485:
                      type: boolean
                      description: Toggle to find device(s) with RS485
                      example: true
                    hide_known_devices:
                      type: boolean
                      description: >-
                        Toggle to show device(s) which already known (added to
                        BioStar X) or not.
                      example: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/udp_search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"UdpSearchOption":{"timeout":3,"with_rs485":true,"hide_known_devices":true}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"UdpSearchOption":{"timeout":3,"with_rs485":true,"hide_known_devices":true}}'
            |  \
              http POST https://{baseurl}/api/devices/udp_search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"UdpSearchOption":{"timeout":3,"with_rs485":true,"hide_known_devices":true}}' \
              --output-document \
              - https://{baseurl}/api/devices/udp_search
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/udp_search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({UdpSearchOption: {timeout: 3, with_rs485:
            true, hide_known_devices: true}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/udp_search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {UdpSearchOption: {timeout: 3, with_rs485: true, hide_known_devices: true}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/udp_search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "UdpSearchOption": {
                "timeout": 3,
                "with_rs485": true,
                "hide_known_devices": true
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/udp_search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {UdpSearchOption: {timeout: 3, with_rs485: true, hide_known_devices: true}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/devices/udp_search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"UdpSearchOption":{"timeout":3,"with_rs485":true,"hide_known_devices":true}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"UdpSearchOption":{"timeout":3,"with_rs485":true,"hide_known_devices":true}}'
            };

            fetch('https://{baseurl}/api/devices/udp_search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/udp_search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "UdpSearchOption": {
                "timeout": 3,
                "with_rs485": true,
                "hide_known_devices": true
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/devices/udp_search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/devices/udp_search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/udp_search"


            payload = {"UdpSearchOption": {
                    "timeout": 3,
                    "with_rs485": True,
                    "hide_known_devices": True
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/devices/udp_search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/udp_search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/udp_search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"UdpSearchOption":{"timeout":3,"with_rs485":true,"hide_known_devices":true}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"UdpSearchOption":{"timeout":3,"with_rs485":true,"hide_known_devices":true}}');


            $request->setRequestUrl('https://{baseurl}/api/devices/udp_search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/udp_search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/udp_search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/udp_search\"\n\n\tpayload := strings.NewReader(\"{\\\"UdpSearchOption\\\":{\\\"timeout\\\":3,\\\"with_rs485\\\":true,\\\"hide_known_devices\\\":true}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/udp_search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"UdpSearchOption": @{ @"timeout": @3,
            @"with_rs485": @YES, @"hide_known_devices": @YES } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/udp_search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["UdpSearchOption": [
                "timeout": 3,
                "with_rs485": true,
                "hide_known_devices": true
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/udp_search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/udp_search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/udp_search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/udp_search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"UdpSearchOption":{"timeout":3,"with_rs485":true,"hide_known_devices":true}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/udp_search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"UdpSearchOption":{"timeout":3,"with_rs485":true,"hide_known_devices":true}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/udp_search"


            payload <-
            "{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices/udp_search"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"UdpSearchOption\":{\"timeout\":3,\"with_rs485\":true,\"hide_known_devices\":true}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/udp_search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/udp_get:
    post:
      tags:
        - Device
      summary: View Device IP Settings
      operationId: createDeviceUdpGet
      description: >-
        This API is used to get the IP settings of a device which have not been
        added to BioStar X.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Device:
                  type: object
                  required:
                    - id
                  properties:
                    id:
                      type: integer
                      description: ID of the device which the IP setting will be viewed.
                      example: 543408590
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/udp_get \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Device":{"id":543408590}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"Device":{"id":543408590}}' |  \
              http POST https://{baseurl}/api/devices/udp_get \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Device":{"id":543408590}}' \
              --output-document \
              - https://{baseurl}/api/devices/udp_get
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/udp_get",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({Device: {id: 543408590}}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/udp_get',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {Device: {id: 543408590}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/udp_get");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "Device": {
                "id": 543408590
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/udp_get',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {Device: {id: 543408590}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/devices/udp_get';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Device":{"id":543408590}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Device":{"id":543408590}}'
            };

            fetch('https://{baseurl}/api/devices/udp_get', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/udp_get",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Device\":{\"id\":543408590}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Device": {
                "id": 543408590
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/devices/udp_get");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"Device\":{\"id\":543408590}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/devices/udp_get", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/udp_get"


            payload = {"Device": {"id": 543408590}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/udp_get")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"Device\":{\"id\":543408590}}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/udp_get",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Device\":{\"id\":543408590}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/devices/udp_get');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"Device":{"id":543408590}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"Device":{"id":543408590}}');

            $request->setRequestUrl('https://{baseurl}/api/devices/udp_get');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Device\":{\"id\":543408590}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/udp_get")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/udp_get")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Device\":{\"id\":543408590}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/udp_get\"\n\n\tpayload := strings.NewReader(\"{\\\"Device\\\":{\\\"id\\\":543408590}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/udp_get");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Device\":{\"id\":543408590}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Device": @{ @"id": @543408590 } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/udp_get"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Device": ["id": 543408590]] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/udp_get")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/udp_get");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Device\":{\"id\":543408590}}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/udp_get"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Device\":{\"id\":543408590}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/udp_get' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Device":{"id":543408590}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/udp_get' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Device":{"id":543408590}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/udp_get"


            payload <- "{\"Device\":{\"id\":543408590}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices/udp_get" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Device\":{\"id\":543408590}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Device\":{\"id\":543408590}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/udp_get")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/udp_put:
    post:
      tags:
        - Device
      summary: Update Device IP Settings
      operationId: createDeviceUdpPut
      description: >-
        This API is used to update IP settings on device which have not been
        added to BioStar X.


        It is required to fill in the id parameter with the id of the device
        which the IP settings will be updated.


        Fill in the required value on the respective parameters and remove those
        which is not required.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Device:
                  type: object
                  required:
                    - id
                  properties:
                    id:
                      type: integer
                      description: ID of the device which will be updated.
                      example: 543408590
                    lan:
                      type: object
                      properties:
                        connection_mode:
                          type: integer
                          description: >-
                            Connection mode of the device. (`0` = **Server** →
                            **Device**, `1` = **Device** → **Server**)
                          example: 0
                        enable_dhcp:
                          type: boolean
                          description: Toggle true to enable DHCP
                          example: false
                        use_dns:
                          type: boolean
                          description: Toggle true to use DNS
                          example: false
                        ip:
                          type: string
                          description: IP of the device
                          example: 192.168.1.25
                        device_port:
                          type: integer
                          description: Connection port which the device use
                          example: 51211
                        gateway:
                          type: string
                          description: IP gateway which the device use
                          example: 192.168.1.1
                        subnet_mask:
                          type: string
                          description: Subnet of the device
                          example: 255.255.255.0
                        server_port:
                          type: integer
                          description: Connection port of the server
                          example: 51212
                        server_ip:
                          type: string
                          description: IP of the server
                          example: 192.168.1.5
                    device_type_id:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: Device type ID
                          example: 31
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/udp_put \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Device":{"id":543408590,"lan":{"connection_mode":0,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.25","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"device_type_id":{"id":31}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Device":{"id":543408590,"lan":{"connection_mode":0,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.25","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"device_type_id":{"id":31}}}'
            |  \
              http POST https://{baseurl}/api/devices/udp_put \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Device":{"id":543408590,"lan":{"connection_mode":0,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.25","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"device_type_id":{"id":31}}}' \
              --output-document \
              - https://{baseurl}/api/devices/udp_put
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/udp_put",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Device: {
                id: 543408590,
                lan: {
                  connection_mode: 0,
                  enable_dhcp: false,
                  use_dns: false,
                  ip: '192.168.1.25',
                  device_port: 51211,
                  gateway: '192.168.1.1',
                  subnet_mask: '255.255.255.0',
                  server_port: 51212,
                  server_ip: '192.168.1.5'
                },
                device_type_id: {id: 31}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/udp_put',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Device: {
                  id: 543408590,
                  lan: {
                    connection_mode: 0,
                    enable_dhcp: false,
                    use_dns: false,
                    ip: '192.168.1.25',
                    device_port: 51211,
                    gateway: '192.168.1.1',
                    subnet_mask: '255.255.255.0',
                    server_port: 51212,
                    server_ip: '192.168.1.5'
                  },
                  device_type_id: {id: 31}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/udp_put");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "Device": {
                "id": 543408590,
                "lan": {
                  "connection_mode": 0,
                  "enable_dhcp": false,
                  "use_dns": false,
                  "ip": "192.168.1.25",
                  "device_port": 51211,
                  "gateway": "192.168.1.1",
                  "subnet_mask": "255.255.255.0",
                  "server_port": 51212,
                  "server_ip": "192.168.1.5"
                },
                "device_type_id": {
                  "id": 31
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/udp_put',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Device: {
                  id: 543408590,
                  lan: {
                    connection_mode: 0,
                    enable_dhcp: false,
                    use_dns: false,
                    ip: '192.168.1.25',
                    device_port: 51211,
                    gateway: '192.168.1.1',
                    subnet_mask: '255.255.255.0',
                    server_port: 51212,
                    server_ip: '192.168.1.5'
                  },
                  device_type_id: {id: 31}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/devices/udp_put';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Device":{"id":543408590,"lan":{"connection_mode":0,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.25","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"device_type_id":{"id":31}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Device":{"id":543408590,"lan":{"connection_mode":0,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.25","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"device_type_id":{"id":31}}}'
            };

            fetch('https://{baseurl}/api/devices/udp_put', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/udp_put",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Device": {
                "id": 543408590,
                "lan": {
                  "connection_mode": 0,
                  "enable_dhcp": false,
                  "use_dns": false,
                  "ip": "192.168.1.25",
                  "device_port": 51211,
                  "gateway": "192.168.1.1",
                  "subnet_mask": "255.255.255.0",
                  "server_port": 51212,
                  "server_ip": "192.168.1.5"
                },
                "device_type_id": {
                  "id": 31
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/devices/udp_put");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/devices/udp_put", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/udp_put"


            payload = {"Device": {
                    "id": 543408590,
                    "lan": {
                        "connection_mode": 0,
                        "enable_dhcp": False,
                        "use_dns": False,
                        "ip": "192.168.1.25",
                        "device_port": 51211,
                        "gateway": "192.168.1.1",
                        "subnet_mask": "255.255.255.0",
                        "server_port": 51212,
                        "server_ip": "192.168.1.5"
                    },
                    "device_type_id": {"id": 31}
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/devices/udp_put")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/udp_put",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/udp_put');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Device":{"id":543408590,"lan":{"connection_mode":0,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.25","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"device_type_id":{"id":31}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Device":{"id":543408590,"lan":{"connection_mode":0,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.25","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"device_type_id":{"id":31}}}');


            $request->setRequestUrl('https://{baseurl}/api/devices/udp_put');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/udp_put")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/udp_put")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/udp_put\"\n\n\tpayload := strings.NewReader(\"{\\\"Device\\\":{\\\"id\\\":543408590,\\\"lan\\\":{\\\"connection_mode\\\":0,\\\"enable_dhcp\\\":false,\\\"use_dns\\\":false,\\\"ip\\\":\\\"192.168.1.25\\\",\\\"device_port\\\":51211,\\\"gateway\\\":\\\"192.168.1.1\\\",\\\"subnet_mask\\\":\\\"255.255.255.0\\\",\\\"server_port\\\":51212,\\\"server_ip\\\":\\\"192.168.1.5\\\"},\\\"device_type_id\\\":{\\\"id\\\":31}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/udp_put");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Device": @{ @"id": @543408590,
            @"lan": @{ @"connection_mode": @0, @"enable_dhcp": @NO, @"use_dns":
            @NO, @"ip": @"192.168.1.25", @"device_port": @51211, @"gateway":
            @"192.168.1.1", @"subnet_mask": @"255.255.255.0", @"server_port":
            @51212, @"server_ip": @"192.168.1.5" }, @"device_type_id": @{ @"id":
            @31 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/udp_put"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Device": [
                "id": 543408590,
                "lan": [
                  "connection_mode": 0,
                  "enable_dhcp": false,
                  "use_dns": false,
                  "ip": "192.168.1.25",
                  "device_port": 51211,
                  "gateway": "192.168.1.1",
                  "subnet_mask": "255.255.255.0",
                  "server_port": 51212,
                  "server_ip": "192.168.1.5"
                ],
                "device_type_id": ["id": 31]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/udp_put")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/udp_put");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/udp_put"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/udp_put' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Device":{"id":543408590,"lan":{"connection_mode":0,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.25","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"device_type_id":{"id":31}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/udp_put' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Device":{"id":543408590,"lan":{"connection_mode":0,"enable_dhcp":false,"use_dns":false,"ip":"192.168.1.25","device_port":51211,"gateway":"192.168.1.1","subnet_mask":"255.255.255.0","server_port":51212,"server_ip":"192.168.1.5"},"device_type_id":{"id":31}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/udp_put"


            payload <-
            "{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices/udp_put" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Device\":{\"id\":543408590,\"lan\":{\"connection_mode\":0,\"enable_dhcp\":false,\"use_dns\":false,\"ip\":\"192.168.1.25\",\"device_port\":51211,\"gateway\":\"192.168.1.1\",\"subnet_mask\":\"255.255.255.0\",\"server_port\":51212,\"server_ip\":\"192.168.1.5\"},\"device_type_id\":{\"id\":31}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/udp_put")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{id}/connect:
    post:
      tags:
        - Device
      summary: Connect Device
      operationId: createDeviceConnect
      description: This API is used to connect a device which have been disconnected.
      requestBody:
        content: {}
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device which will be connected
          example: 542353521
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/542353521/connect \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http POST https://{baseurl}/api/devices/542353521/connect \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices/542353521/connect
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/542353521/connect",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/542353521/connect',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/542353521/connect");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/542353521/connect',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices/542353521/connect';


            let options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/542353521/connect', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/542353521/connect",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/devices/542353521/connect");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("POST", "{baseurl}/api/devices/542353521/connect",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices/542353521/connect"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("POST", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/542353521/connect")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/542353521/connect",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/devices/542353521/connect');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/542353521/connect');

            $request->setRequestMethod('POST');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/542353521/connect")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/542353521/connect")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/542353521/connect\"\n\n\treq, _ := http.NewRequest(\"POST\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/542353521/connect");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/542353521/connect"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/542353521/connect")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/542353521/connect");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/542353521/connect"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/542353521/connect' -Method POST
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/542353521/connect' -Method POST
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/542353521/connect"


            response <- VERB("POST", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/542353521/connect" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/542353521/connect")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{id}/disconnect:
    post:
      tags:
        - Device
      summary: Disconnect Device
      operationId: createDeviceDisconnect
      description: This API is used to disconnect a device connection from BioStar X.
      requestBody:
        content: {}
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device which will be disconnected
          example: 542353521
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/542353521/disconnect \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http POST https://{baseurl}/api/devices/542353521/disconnect \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices/542353521/disconnect
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/542353521/disconnect",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/542353521/disconnect',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/542353521/disconnect");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/542353521/disconnect',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices/542353521/disconnect';


            let options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/542353521/disconnect', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/542353521/disconnect",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/devices/542353521/disconnect");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("POST", "{baseurl}/api/devices/542353521/disconnect",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices/542353521/disconnect"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("POST", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/542353521/disconnect")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/542353521/disconnect",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/542353521/disconnect');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/542353521/disconnect');

            $request->setRequestMethod('POST');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/542353521/disconnect")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/542353521/disconnect")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/542353521/disconnect\"\n\n\treq, _ := http.NewRequest(\"POST\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/542353521/disconnect");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/542353521/disconnect"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/542353521/disconnect")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/542353521/disconnect");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/542353521/disconnect"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/542353521/disconnect' -Method POST
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/542353521/disconnect' -Method POST
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/542353521/disconnect"


            response <- VERB("POST", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/542353521/disconnect" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/542353521/disconnect")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{id}/discover_wiegand:
    post:
      tags:
        - Device
      summary: Find Wiegand
      operationId: createDeviceDiscoverWiegand
      description: This API is used to find wiegand device attached to master device.
      requestBody:
        content: {}
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the master device
          example: 544140034
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/544140034/discover_wiegand \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http POST https://{baseurl}/api/devices/544140034/discover_wiegand \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices/544140034/discover_wiegand
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/544140034/discover_wiegand",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/544140034/discover_wiegand',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/544140034/discover_wiegand");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/544140034/discover_wiegand',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/devices/544140034/discover_wiegand';


            let options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/544140034/discover_wiegand',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/544140034/discover_wiegand",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/devices/544140034/discover_wiegand");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("POST",
            "{baseurl}/api/devices/544140034/discover_wiegand", headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices/544140034/discover_wiegand"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("POST", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/devices/544140034/discover_wiegand")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/544140034/discover_wiegand",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/544140034/discover_wiegand');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/544140034/discover_wiegand');

            $request->setRequestMethod('POST');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/544140034/discover_wiegand")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/544140034/discover_wiegand")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/544140034/discover_wiegand\"\n\n\treq, _ := http.NewRequest(\"POST\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/544140034/discover_wiegand");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/544140034/discover_wiegand"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/544140034/discover_wiegand")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/544140034/discover_wiegand");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/544140034/discover_wiegand"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/544140034/discover_wiegand' -Method
            POST -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/544140034/discover_wiegand' -Method
            POST -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/544140034/discover_wiegand"


            response <- VERB("POST", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/544140034/discover_wiegand" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/544140034/discover_wiegand")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{id}/discover:
    post:
      tags:
        - Device
      summary: Find Slave Device
      operationId: createDeviceDiscover
      description: This API is used to find slave device attached to a master device.
      requestBody:
        content: {}
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the master device
          example: 544140034
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/544140034/discover \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http POST https://{baseurl}/api/devices/544140034/discover \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices/544140034/discover
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/544140034/discover",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/544140034/discover',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/544140034/discover");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/544140034/discover',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices/544140034/discover';


            let options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/544140034/discover', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/544140034/discover",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/devices/544140034/discover");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("POST", "{baseurl}/api/devices/544140034/discover",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices/544140034/discover"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("POST", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/544140034/discover")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/544140034/discover",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/544140034/discover');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/544140034/discover');

            $request->setRequestMethod('POST');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/544140034/discover")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/544140034/discover")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/544140034/discover\"\n\n\treq, _ := http.NewRequest(\"POST\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/544140034/discover");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/544140034/discover"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/544140034/discover")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/544140034/discover");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/544140034/discover"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/544140034/discover' -Method POST
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/544140034/discover' -Method POST
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/544140034/discover"


            response <- VERB("POST", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/544140034/discover" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/544140034/discover")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{id}/scan_card:
    post:
      tags:
        - Create User
      summary: 04a Enroll Card Credential
      operationId: createDeviceScanCard
      description: >-
        Next step on creating a new user it to enroll the credential that the
        user will be using. Either it's Card, Face, Visual Face or Fingerprint.


        This API is used to enroll card credential using the specified device.


        Keep the card_id value on the response which shows after running this
        API to apply it to the user which will be created.


        To view device(s) with capability to enroll a card, use **View Device(s)
        Based on Enrollment Type** API.
      requestBody:
        content: {}
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device which will be used for enrollment
          example: 543720368
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/543720368/scan_card \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http POST https://{baseurl}/api/devices/543720368/scan_card \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices/543720368/scan_card
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/543720368/scan_card",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/543720368/scan_card',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/543720368/scan_card");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/543720368/scan_card',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices/543720368/scan_card';


            let options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/543720368/scan_card', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/543720368/scan_card",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/devices/543720368/scan_card");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("POST", "{baseurl}/api/devices/543720368/scan_card",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices/543720368/scan_card"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("POST", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/543720368/scan_card")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/543720368/scan_card",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/543720368/scan_card');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/543720368/scan_card');

            $request->setRequestMethod('POST');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/543720368/scan_card")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/543720368/scan_card")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/543720368/scan_card\"\n\n\treq, _ := http.NewRequest(\"POST\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/543720368/scan_card");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/543720368/scan_card"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/543720368/scan_card")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/543720368/scan_card");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/543720368/scan_card"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/543720368/scan_card' -Method POST
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/543720368/scan_card' -Method POST
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/543720368/scan_card"


            response <- VERB("POST", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/543720368/scan_card" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/543720368/scan_card")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{id}/credentials/face:
    get:
      tags:
        - Create User
      summary: 04b Enroll Face Credential
      operationId: getDeviceCredentialsFace
      description: >-
        Use this API to enroll face credential from a device.


        Set the `pose_sensitivity` to `0` if you're doing a Visual Face scan.


        Keep the response of this API after running to apply it to the user
        which will be created.


        To view device(s) with capability to enroll Face/Visual Face, use `View
        Device(s) Based on Enrollment Type` API.
      parameters:
        - name: pose_sensitivity
          in: query
          schema:
            type: integer
          description: >-
            Set the sensitivity for the position, angle, and distance of a face
            when registering the face. Set the sensitivity high if you wish to
            obtain a detailed face template. 0-9
          example: 4
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device which will be used to enroll
          example: 543408590
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/543408590/credentials/face',
              qs: {pose_sensitivity: '4'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/devices/543408590/credentials/face");


            req.query({
              "pose_sensitivity": "4"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/543408590/credentials/face',
              params: {pose_sensitivity: '4'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/543408590/credentials/face"


            querystring = {"pose_sensitivity":"4"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/543408590/credentials/face');

            $request->setMethod(HTTP_METH_GET);


            $request->setQueryData([
              'pose_sensitivity' => '4'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/543408590/credentials/face');

            $request->setRequestMethod('GET');

            $request->setQuery(new http\QueryString([
              'pose_sensitivity' => '4'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/543408590/credentials/face"


            queryString <- list([ 'pose_sensitivity' ] = "4")


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/543408590/credentials/face?pose_sensitivity=4")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{dev_id}/scan_fingerprint:
    post:
      tags:
        - Create User
      summary: 04c Enroll Fingerprint
      operationId: createDeviceScanFingerprint
      description: >-
        Use this API to scan a fingerprint.


        On calling this API, it is required to specify the device which will be
        used as fingerprint scanner. It is done by specifying Device ID on the
        API Path, which marked by `:dev_id`.


        The procedure to add a fingerprint as follows:

        - Scan a finger using this API

        - Use `POST /api/server_matching/identify_finger` to check if it's
        already exist

        - If it's not exist, then run a second scan using this API for the same
        finger

        - Compare 1st and 2nd scan result using `POST
        /api/devices/:dev_id/verify_fingerprint` to make sure that 1st and 2nd
        scan are the same finger  

        - After running `Verify Fingerprint Scan`, keep the value of template 0
        and 1 to assign the enrolled finger to a user using `POST|PUT
        /api/users/:id`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - ScanFingerprintOption
                - noblockui
              properties:
                ScanFingerprintOption:
                  type: object
                  required:
                    - enroll_quality
                    - raw_image
                  properties:
                    enroll_quality:
                      type: integer
                      description: >-
                        Set a fingerprint enrollment quality level. Any
                        fingerprint which does not meet the quality requirement
                        will not be enrolled.
                      example: 80
                    raw_image:
                      type: boolean
                      description: >-
                        Set this option to view the original image when a
                        fingerprint is scanned.
                      example: false
                noblockui:
                  type: boolean
                  example: true
      parameters:
        - name: dev_id
          description: Unique identifier of the device to perform fingerprint scanning
          in: path
          schema:
            type: integer
          required: true
          example: 544140034
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/544140034/scan_fingerprint \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ScanFingerprintOption":{"enroll_quality":80,"raw_image":false},"noblockui":true}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"ScanFingerprintOption":{"enroll_quality":80,"raw_image":false},"noblockui":true}'
            |  \
              http POST https://{baseurl}/api/devices/544140034/scan_fingerprint \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ScanFingerprintOption":{"enroll_quality":80,"raw_image":false},"noblockui":true}' \
              --output-document \
              - https://{baseurl}/api/devices/544140034/scan_fingerprint
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/544140034/scan_fingerprint",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({ScanFingerprintOption: {enroll_quality:
            80, raw_image: false}, noblockui: true}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/544140034/scan_fingerprint',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {ScanFingerprintOption: {enroll_quality: 80, raw_image: false}, noblockui: true},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/544140034/scan_fingerprint");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "ScanFingerprintOption": {
                "enroll_quality": 80,
                "raw_image": false
              },
              "noblockui": true
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/544140034/scan_fingerprint',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {ScanFingerprintOption: {enroll_quality: 80, raw_image: false}, noblockui: true}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/devices/544140034/scan_fingerprint';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ScanFingerprintOption":{"enroll_quality":80,"raw_image":false},"noblockui":true}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ScanFingerprintOption":{"enroll_quality":80,"raw_image":false},"noblockui":true}'
            };


            fetch('https://{baseurl}/api/devices/544140034/scan_fingerprint',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/544140034/scan_fingerprint",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "ScanFingerprintOption": {
                "enroll_quality": 80,
                "raw_image": false
              },
              "noblockui": true
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/devices/544140034/scan_fingerprint");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/devices/544140034/scan_fingerprint", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/544140034/scan_fingerprint"


            payload = {
                "ScanFingerprintOption": {
                    "enroll_quality": 80,
                    "raw_image": False
                },
                "noblockui": True
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/devices/544140034/scan_fingerprint")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/544140034/scan_fingerprint",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/544140034/scan_fingerprint');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"ScanFingerprintOption":{"enroll_quality":80,"raw_image":false},"noblockui":true}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ScanFingerprintOption":{"enroll_quality":80,"raw_image":false},"noblockui":true}');


            $request->setRequestUrl('https://{baseurl}/api/devices/544140034/scan_fingerprint');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/544140034/scan_fingerprint")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/544140034/scan_fingerprint")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/544140034/scan_fingerprint\"\n\n\tpayload := strings.NewReader(\"{\\\"ScanFingerprintOption\\\":{\\\"enroll_quality\\\":80,\\\"raw_image\\\":false},\\\"noblockui\\\":true}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/544140034/scan_fingerprint");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ScanFingerprintOption": @{
            @"enroll_quality": @80, @"raw_image": @NO },
                                          @"noblockui": @YES };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/544140034/scan_fingerprint"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "ScanFingerprintOption": [
                "enroll_quality": 80,
                "raw_image": false
              ],
              "noblockui": true
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/544140034/scan_fingerprint")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/544140034/scan_fingerprint");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/544140034/scan_fingerprint"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/544140034/scan_fingerprint' -Method
            POST -Headers $headers -ContentType 'application/json' -Body
            '{"ScanFingerprintOption":{"enroll_quality":80,"raw_image":false},"noblockui":true}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/544140034/scan_fingerprint' -Method
            POST -Headers $headers -ContentType 'application/json' -Body
            '{"ScanFingerprintOption":{"enroll_quality":80,"raw_image":false},"noblockui":true}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/544140034/scan_fingerprint"


            payload <-
            "{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/544140034/scan_fingerprint" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"ScanFingerprintOption\":{\"enroll_quality\":80,\"raw_image\":false},\"noblockui\":true}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/544140034/scan_fingerprint")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/users:
    post:
      tags:
        - Create User
      summary: 05 Create New User
      operationId: createUser
      description: >-
        After preparing available user_id and credential(s), use this API to
        create a new user using the basic configuration.


        For applying configuration beyond this, such as credential(s) or custom
        fields, refer to the subsequent example.


        When Setting > Server is set to Number, you can make use of endpoint
        `/api/users/next_user_id` to automatically get the next user_id.


        **Known validation errors:**

        - `name` is more than 48 characters

        - Using single quote on name

        - Duplicate `user_id`, `email`, or `login_id`

        - Empty required fields

        - Using non-existent user_group_id

        - Password with 3 or more subsequent letter or number

        - Start and expiry date difference is more than 30 years
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserInput'
      responses:
        '200':
          description: User created successfully
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/users \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"User":{"user_id":"1001","name":"John Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"john.doe@example.com","department":"Engineering","title":"Software Engineer","photo":"","phone":"+1-555-0123","permission":{"id":"1"},"access_groups":[{"id":"1"}],"login_id":"john.doe","password":"ZxwOzbCK2VQ1dyv","user_ip":"192.168.1.100","pin":1234}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"User":{"user_id":"1001","name":"John
            Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"john.doe@example.com","department":"Engineering","title":"Software
            Engineer","photo":"","phone":"+1-555-0123","permission":{"id":"1"},"access_groups":[{"id":"1"}],"login_id":"john.doe","password":"ZxwOzbCK2VQ1dyv","user_ip":"192.168.1.100","pin":1234}}'
            |  \
              http POST https://{baseurl}/api/users \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"User":{"user_id":"1001","name":"John Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"john.doe@example.com","department":"Engineering","title":"Software Engineer","photo":"","phone":"+1-555-0123","permission":{"id":"1"},"access_groups":[{"id":"1"}],"login_id":"john.doe","password":"ZxwOzbCK2VQ1dyv","user_ip":"192.168.1.100","pin":1234}}' \
              --output-document \
              - https://{baseurl}/api/users
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              User: {
                user_id: '1001',
                name: 'John Doe',
                user_group_id: {id: '1'},
                disabled: false,
                start_datetime: '2001-01-01T00:00:00.00Z',
                expiry_datetime: '2030-12-31T23:59:00.00Z',
                email: 'john.doe@example.com',
                department: 'Engineering',
                title: 'Software Engineer',
                photo: '',
                phone: '+1-555-0123',
                permission: {id: '1'},
                access_groups: [{id: '1'}],
                login_id: 'john.doe',
                password: 'ZxwOzbCK2VQ1dyv',
                user_ip: '192.168.1.100',
                pin: 1234
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                User: {
                  user_id: '1001',
                  name: 'John Doe',
                  user_group_id: {id: '1'},
                  disabled: false,
                  start_datetime: '2001-01-01T00:00:00.00Z',
                  expiry_datetime: '2030-12-31T23:59:00.00Z',
                  email: 'john.doe@example.com',
                  department: 'Engineering',
                  title: 'Software Engineer',
                  photo: '',
                  phone: '+1-555-0123',
                  permission: {id: '1'},
                  access_groups: [{id: '1'}],
                  login_id: 'john.doe',
                  password: 'ZxwOzbCK2VQ1dyv',
                  user_ip: '192.168.1.100',
                  pin: 1234
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/users");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "User": {
                "user_id": "1001",
                "name": "John Doe",
                "user_group_id": {
                  "id": "1"
                },
                "disabled": false,
                "start_datetime": "2001-01-01T00:00:00.00Z",
                "expiry_datetime": "2030-12-31T23:59:00.00Z",
                "email": "john.doe@example.com",
                "department": "Engineering",
                "title": "Software Engineer",
                "photo": "",
                "phone": "+1-555-0123",
                "permission": {
                  "id": "1"
                },
                "access_groups": [
                  {
                    "id": "1"
                  }
                ],
                "login_id": "john.doe",
                "password": "ZxwOzbCK2VQ1dyv",
                "user_ip": "192.168.1.100",
                "pin": 1234
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/users',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                User: {
                  user_id: '1001',
                  name: 'John Doe',
                  user_group_id: {id: '1'},
                  disabled: false,
                  start_datetime: '2001-01-01T00:00:00.00Z',
                  expiry_datetime: '2030-12-31T23:59:00.00Z',
                  email: 'john.doe@example.com',
                  department: 'Engineering',
                  title: 'Software Engineer',
                  photo: '',
                  phone: '+1-555-0123',
                  permission: {id: '1'},
                  access_groups: [{id: '1'}],
                  login_id: 'john.doe',
                  password: 'ZxwOzbCK2VQ1dyv',
                  user_ip: '192.168.1.100',
                  pin: 1234
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/users';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"User":{"user_id":"1001","name":"John Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"john.doe@example.com","department":"Engineering","title":"Software Engineer","photo":"","phone":"+1-555-0123","permission":{"id":"1"},"access_groups":[{"id":"1"}],"login_id":"john.doe","password":"ZxwOzbCK2VQ1dyv","user_ip":"192.168.1.100","pin":1234}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"User":{"user_id":"1001","name":"John Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"john.doe@example.com","department":"Engineering","title":"Software Engineer","photo":"","phone":"+1-555-0123","permission":{"id":"1"},"access_groups":[{"id":"1"}],"login_id":"john.doe","password":"ZxwOzbCK2VQ1dyv","user_ip":"192.168.1.100","pin":1234}}'
            };

            fetch('https://{baseurl}/api/users', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"User\":{\"user_id\":\"1001\",\"name\":\"John Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "User": {
                "user_id": "1001",
                "name": "John Doe",
                "user_group_id": {
                  "id": "1"
                },
                "disabled": false,
                "start_datetime": "2001-01-01T00:00:00.00Z",
                "expiry_datetime": "2030-12-31T23:59:00.00Z",
                "email": "john.doe@example.com",
                "department": "Engineering",
                "title": "Software Engineer",
                "photo": "",
                "phone": "+1-555-0123",
                "permission": {
                  "id": "1"
                },
                "access_groups": [
                  {
                    "id": "1"
                  }
                ],
                "login_id": "john.doe",
                "password": "ZxwOzbCK2VQ1dyv",
                "user_ip": "192.168.1.100",
                "pin": 1234
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/users");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"User\":{\"user_id\":\"1001\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software
            Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/users", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users"


            payload = {"User": {
                    "user_id": "1001",
                    "name": "John Doe",
                    "user_group_id": {"id": "1"},
                    "disabled": False,
                    "start_datetime": "2001-01-01T00:00:00.00Z",
                    "expiry_datetime": "2030-12-31T23:59:00.00Z",
                    "email": "john.doe@example.com",
                    "department": "Engineering",
                    "title": "Software Engineer",
                    "photo": "",
                    "phone": "+1-555-0123",
                    "permission": {"id": "1"},
                    "access_groups": [{"id": "1"}],
                    "login_id": "john.doe",
                    "password": "ZxwOzbCK2VQ1dyv",
                    "user_ip": "192.168.1.100",
                    "pin": 1234
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/users")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"User\":{\"user_id\":\"1001\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software
            Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"User\":{\"user_id\":\"1001\",\"name\":\"John Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"User":{"user_id":"1001","name":"John
            Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"john.doe@example.com","department":"Engineering","title":"Software
            Engineer","photo":"","phone":"+1-555-0123","permission":{"id":"1"},"access_groups":[{"id":"1"}],"login_id":"john.doe","password":"ZxwOzbCK2VQ1dyv","user_ip":"192.168.1.100","pin":1234}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"User":{"user_id":"1001","name":"John
            Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"john.doe@example.com","department":"Engineering","title":"Software
            Engineer","photo":"","phone":"+1-555-0123","permission":{"id":"1"},"access_groups":[{"id":"1"}],"login_id":"john.doe","password":"ZxwOzbCK2VQ1dyv","user_ip":"192.168.1.100","pin":1234}}');


            $request->setRequestUrl('https://{baseurl}/api/users');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"User\":{\"user_id\":\"1001\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software
            Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/users")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"User\":{\"user_id\":\"1001\",\"name\":\"John Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users\"\n\n\tpayload := strings.NewReader(\"{\\\"User\\\":{\\\"user_id\\\":\\\"1001\\\",\\\"name\\\":\\\"John Doe\\\",\\\"user_group_id\\\":{\\\"id\\\":\\\"1\\\"},\\\"disabled\\\":false,\\\"start_datetime\\\":\\\"2001-01-01T00:00:00.00Z\\\",\\\"expiry_datetime\\\":\\\"2030-12-31T23:59:00.00Z\\\",\\\"email\\\":\\\"john.doe@example.com\\\",\\\"department\\\":\\\"Engineering\\\",\\\"title\\\":\\\"Software Engineer\\\",\\\"photo\\\":\\\"\\\",\\\"phone\\\":\\\"+1-555-0123\\\",\\\"permission\\\":{\\\"id\\\":\\\"1\\\"},\\\"access_groups\\\":[{\\\"id\\\":\\\"1\\\"}],\\\"login_id\\\":\\\"john.doe\\\",\\\"password\\\":\\\"ZxwOzbCK2VQ1dyv\\\",\\\"user_ip\\\":\\\"192.168.1.100\\\",\\\"pin\\\":1234}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL, "https://{baseurl}/api/users");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"User\":{\"user_id\":\"1001\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software
            Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"User": @{ @"user_id": @"1001",
            @"name": @"John Doe", @"user_group_id": @{ @"id": @"1" },
            @"disabled": @NO, @"start_datetime": @"2001-01-01T00:00:00.00Z",
            @"expiry_datetime": @"2030-12-31T23:59:00.00Z", @"email":
            @"john.doe@example.com", @"department": @"Engineering", @"title":
            @"Software Engineer", @"photo": @"", @"phone": @"+1-555-0123",
            @"permission": @{ @"id": @"1" }, @"access_groups": @[ @{ @"id": @"1"
            } ], @"login_id": @"john.doe", @"password": @"ZxwOzbCK2VQ1dyv",
            @"user_ip": @"192.168.1.100", @"pin": @1234 } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL URLWithString:@"https://{baseurl}/api/users"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["User": [
                "user_id": "1001",
                "name": "John Doe",
                "user_group_id": ["id": "1"],
                "disabled": false,
                "start_datetime": "2001-01-01T00:00:00.00Z",
                "expiry_datetime": "2030-12-31T23:59:00.00Z",
                "email": "john.doe@example.com",
                "department": "Engineering",
                "title": "Software Engineer",
                "photo": "",
                "phone": "+1-555-0123",
                "permission": ["id": "1"],
                "access_groups": [["id": "1"]],
                "login_id": "john.doe",
                "password": "ZxwOzbCK2VQ1dyv",
                "user_ip": "192.168.1.100",
                "pin": 1234
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/users");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"User\":{\"user_id\":\"1001\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software
            Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/users"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"User\":{\"user_id\":\"1001\",\"name\":\"John Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/users'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"User":{"user_id":"1001","name":"John
            Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"john.doe@example.com","department":"Engineering","title":"Software
            Engineer","photo":"","phone":"+1-555-0123","permission":{"id":"1"},"access_groups":[{"id":"1"}],"login_id":"john.doe","password":"ZxwOzbCK2VQ1dyv","user_ip":"192.168.1.100","pin":1234}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/users'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"User":{"user_id":"1001","name":"John
            Doe","user_group_id":{"id":"1"},"disabled":false,"start_datetime":"2001-01-01T00:00:00.00Z","expiry_datetime":"2030-12-31T23:59:00.00Z","email":"john.doe@example.com","department":"Engineering","title":"Software
            Engineer","photo":"","phone":"+1-555-0123","permission":{"id":"1"},"access_groups":[{"id":"1"}],"login_id":"john.doe","password":"ZxwOzbCK2VQ1dyv","user_ip":"192.168.1.100","pin":1234}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users"


            payload <- "{\"User\":{\"user_id\":\"1001\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software
            Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/users" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"User\":{\"user_id\":\"1001\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software
            Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"User\":{\"user_id\":\"1001\",\"name\":\"John
            Doe\",\"user_group_id\":{\"id\":\"1\"},\"disabled\":false,\"start_datetime\":\"2001-01-01T00:00:00.00Z\",\"expiry_datetime\":\"2030-12-31T23:59:00.00Z\",\"email\":\"john.doe@example.com\",\"department\":\"Engineering\",\"title\":\"Software
            Engineer\",\"photo\":\"\",\"phone\":\"+1-555-0123\",\"permission\":{\"id\":\"1\"},\"access_groups\":[{\"id\":\"1\"}],\"login_id\":\"john.doe\",\"password\":\"ZxwOzbCK2VQ1dyv\",\"user_ip\":\"192.168.1.100\",\"pin\":1234}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - User
      summary: Delete User(s)
      operationId: deleteUser
      description: |-
        This API is used to delete user(s) from BioStar X.

        **Known errors:**

        - Empty parameter `id``
            
        - Using `id`` which doesn't exist
      parameters:
        - name: id
          in: query
          schema:
            type: string
          description: >-
            ID of the User which will be deleted. To delete multiple Users, use
            plus (+) sign as separator of each User ID. Ex: 1001+1002+1003+1004

            Use GET `/api/users`` to list available users
          example: '{{iterIDVal}}'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/users?id={{iterIDVal}}' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE 'https://{baseurl}/api/users?id={{iterIDVal}}' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/users?id={{iterIDVal}}'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users?id={{iterIDVal}}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/users',
              qs: {id: '{{iterIDVal}}'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("DELETE", "https://{baseurl}/api/users");

            req.query({
              "id": "{{iterIDVal}}"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/users',
              params: {id: '{{iterIDVal}}'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/users?id={{iterIDVal}}';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/users?id={{iterIDVal}}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users?id={{iterIDVal}}",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/users?id={{iterIDVal}}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/users?id={{iterIDVal}}",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users"


            querystring = {"id":"{{iterIDVal}}"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/users?id={{iterIDVal}}")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users?id={{iterIDVal}}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/users');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => '{{iterIDVal}}'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/users');
            $request->setRequestMethod('DELETE');
            $request->setQuery(new http\QueryString([
              'id' => '{{iterIDVal}}'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users?id={{iterIDVal}}")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/users?id={{iterIDVal}}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users?id={{iterIDVal}}\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users?id={{iterIDVal}}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users?id={{iterIDVal}}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users?id={{iterIDVal}}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users?id={{iterIDVal}}");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/users?id={{iterIDVal}}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users?id={{iterIDVal}}' -Method DELETE
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users?id={{iterIDVal}}' -Method DELETE
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users"


            queryString <- list([ 'id' ] = "{{iterIDVal}}")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/users?id={{iterIDVal}}" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/users?id={{iterIDVal}}")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    put:
      tags:
        - User
      summary: Batch Edit with Advanced Search
      operationId: updateUser
      description: >-
        By adding `adv=mode1` on Query Parameter, Batch Edit feature can works
        with Advanced Search result.


        The API works by query users based on adv_criteria object, then apply
        new value based on input in User object.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserBatchEditInput'
      parameters:
        - name: adv
          in: query
          schema:
            type: string
            enum:
              - mode1
          required: true
          description: Use this to enable Advanced Search query result
          example: mode1
      responses:
        '200':
          description: Batch edit completed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserBatchEditResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url 'https://{baseurl}/api/users?adv=mode1' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"User":{"start_datetime":"2001-01-02T00:00:00.00Z","expiry_datetime":"2035-12-31T23:59:00.00Z","disabled":true,"user_group_id":{"id":242894,"name":"test 2","parent_id":{"id":1}},"permission":{"id":2},"access_groups":[{"id":"14"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"User":{"start_datetime":"2001-01-02T00:00:00.00Z","expiry_datetime":"2035-12-31T23:59:00.00Z","disabled":true,"user_group_id":{"id":242894,"name":"test
            2","parent_id":{"id":1}},"permission":{"id":2},"access_groups":[{"id":"14"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
            |  \
              http PUT 'https://{baseurl}/api/users?adv=mode1' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"User":{"start_datetime":"2001-01-02T00:00:00.00Z","expiry_datetime":"2035-12-31T23:59:00.00Z","disabled":true,"user_group_id":{"id":242894,"name":"test 2","parent_id":{"id":1}},"permission":{"id":2},"access_groups":[{"id":"14"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}' \
              --output-document \
              - 'https://{baseurl}/api/users?adv=mode1'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users?adv=mode1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              User: {
                start_datetime: '2001-01-02T00:00:00.00Z',
                expiry_datetime: '2035-12-31T23:59:00.00Z',
                disabled: true,
                user_group_id: {id: 242894, name: 'test 2', parent_id: {id: 1}},
                permission: {id: 2},
                access_groups: [{id: '14'}]
              },
              adv_criteria: {
                limit: 50,
                offset: 0,
                user_id: '11',
                order_by: 'user_id:false',
                user_group_id: 1,
                user_group_ids: [1121],
                user_name: 'John',
                user_email: 'abc@gmail.com',
                user_phone: '123-456-7890',
                user_access_group_ids: '17,18',
                user_operator_level_id: 0,
                user_department: 'Engineering',
                user_title: 'Manager',
                user_card: '123456',
                user_custom_field_1: 'string',
                user_custom_field_2: 'string',
                user_custom_field_3: 'string',
                user_custom_field_4: 'string',
                user_custom_field_5: 'string',
                user_custom_field_6: 'string',
                user_custom_field_7: 'string',
                user_custom_field_8: 'string',
                user_custom_field_9: 'string',
                user_custom_field_10: 'string',
                user_status: false
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/users',
              qs: {adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                User: {
                  start_datetime: '2001-01-02T00:00:00.00Z',
                  expiry_datetime: '2035-12-31T23:59:00.00Z',
                  disabled: true,
                  user_group_id: {id: 242894, name: 'test 2', parent_id: {id: 1}},
                  permission: {id: 2},
                  access_groups: [{id: '14'}]
                },
                adv_criteria: {
                  limit: 50,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/users");

            req.query({
              "adv": "mode1"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "User": {
                "start_datetime": "2001-01-02T00:00:00.00Z",
                "expiry_datetime": "2035-12-31T23:59:00.00Z",
                "disabled": true,
                "user_group_id": {
                  "id": 242894,
                  "name": "test 2",
                  "parent_id": {
                    "id": 1
                  }
                },
                "permission": {
                  "id": 2
                },
                "access_groups": [
                  {
                    "id": "14"
                  }
                ]
              },
              "adv_criteria": {
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/users',
              params: {adv: 'mode1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                User: {
                  start_datetime: '2001-01-02T00:00:00.00Z',
                  expiry_datetime: '2035-12-31T23:59:00.00Z',
                  disabled: true,
                  user_group_id: {id: 242894, name: 'test 2', parent_id: {id: 1}},
                  permission: {id: 2},
                  access_groups: [{id: '14'}]
                },
                adv_criteria: {
                  limit: 50,
                  offset: 0,
                  user_id: '11',
                  order_by: 'user_id:false',
                  user_group_id: 1,
                  user_group_ids: [1121],
                  user_name: 'John',
                  user_email: 'abc@gmail.com',
                  user_phone: '123-456-7890',
                  user_access_group_ids: '17,18',
                  user_operator_level_id: 0,
                  user_department: 'Engineering',
                  user_title: 'Manager',
                  user_card: '123456',
                  user_custom_field_1: 'string',
                  user_custom_field_2: 'string',
                  user_custom_field_3: 'string',
                  user_custom_field_4: 'string',
                  user_custom_field_5: 'string',
                  user_custom_field_6: 'string',
                  user_custom_field_7: 'string',
                  user_custom_field_8: 'string',
                  user_custom_field_9: 'string',
                  user_custom_field_10: 'string',
                  user_status: false
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/users?adv=mode1';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"User":{"start_datetime":"2001-01-02T00:00:00.00Z","expiry_datetime":"2035-12-31T23:59:00.00Z","disabled":true,"user_group_id":{"id":242894,"name":"test 2","parent_id":{"id":1}},"permission":{"id":2},"access_groups":[{"id":"14"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"User":{"start_datetime":"2001-01-02T00:00:00.00Z","expiry_datetime":"2035-12-31T23:59:00.00Z","disabled":true,"user_group_id":{"id":242894,"name":"test 2","parent_id":{"id":1}},"permission":{"id":2},"access_groups":[{"id":"14"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
            };

            fetch('https://{baseurl}/api/users?adv=mode1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users?adv=mode1",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test 2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "User": {
                "start_datetime": "2001-01-02T00:00:00.00Z",
                "expiry_datetime": "2035-12-31T23:59:00.00Z",
                "disabled": true,
                "user_group_id": {
                  "id": 242894,
                  "name": "test 2",
                  "parent_id": {
                    "id": 1
                  }
                },
                "permission": {
                  "id": 2
                },
                "access_groups": [
                  {
                    "id": "14"
                  }
                ]
              },
              "adv_criteria": {
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [
                  1121
                ],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/users?adv=mode1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test
            2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/users?adv=mode1", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users"


            querystring = {"adv":"mode1"}


            payload = {
                "User": {
                    "start_datetime": "2001-01-02T00:00:00.00Z",
                    "expiry_datetime": "2035-12-31T23:59:00.00Z",
                    "disabled": True,
                    "user_group_id": {
                        "id": 242894,
                        "name": "test 2",
                        "parent_id": {"id": 1}
                    },
                    "permission": {"id": 2},
                    "access_groups": [{"id": "14"}]
                },
                "adv_criteria": {
                    "limit": 50,
                    "offset": 0,
                    "user_id": "11",
                    "order_by": "user_id:false",
                    "user_group_id": 1,
                    "user_group_ids": [1121],
                    "user_name": "John",
                    "user_email": "abc@gmail.com",
                    "user_phone": "123-456-7890",
                    "user_access_group_ids": "17,18",
                    "user_operator_level_id": 0,
                    "user_department": "Engineering",
                    "user_title": "Manager",
                    "user_card": "123456",
                    "user_custom_field_1": "string",
                    "user_custom_field_2": "string",
                    "user_custom_field_3": "string",
                    "user_custom_field_4": "string",
                    "user_custom_field_5": "string",
                    "user_custom_field_6": "string",
                    "user_custom_field_7": "string",
                    "user_custom_field_8": "string",
                    "user_custom_field_9": "string",
                    "user_custom_field_10": "string",
                    "user_status": False
                }
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/users?adv=mode1")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test
            2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users?adv=mode1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test 2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/users');

            $request->setMethod(HTTP_METH_PUT);


            $request->setQueryData([
              'adv' => 'mode1'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"User":{"start_datetime":"2001-01-02T00:00:00.00Z","expiry_datetime":"2035-12-31T23:59:00.00Z","disabled":true,"user_group_id":{"id":242894,"name":"test
            2","parent_id":{"id":1}},"permission":{"id":2},"access_groups":[{"id":"14"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"User":{"start_datetime":"2001-01-02T00:00:00.00Z","expiry_datetime":"2035-12-31T23:59:00.00Z","disabled":true,"user_group_id":{"id":242894,"name":"test
            2","parent_id":{"id":1}},"permission":{"id":2},"access_groups":[{"id":"14"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}');


            $request->setRequestUrl('https://{baseurl}/api/users');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'adv' => 'mode1'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test
            2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users?adv=mode1")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/users?adv=mode1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test 2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users?adv=mode1\"\n\n\tpayload := strings.NewReader(\"{\\\"User\\\":{\\\"start_datetime\\\":\\\"2001-01-02T00:00:00.00Z\\\",\\\"expiry_datetime\\\":\\\"2035-12-31T23:59:00.00Z\\\",\\\"disabled\\\":true,\\\"user_group_id\\\":{\\\"id\\\":242894,\\\"name\\\":\\\"test 2\\\",\\\"parent_id\\\":{\\\"id\\\":1}},\\\"permission\\\":{\\\"id\\\":2},\\\"access_groups\\\":[{\\\"id\\\":\\\"14\\\"}]},\\\"adv_criteria\\\":{\\\"limit\\\":50,\\\"offset\\\":0,\\\"user_id\\\":\\\"11\\\",\\\"order_by\\\":\\\"user_id:false\\\",\\\"user_group_id\\\":1,\\\"user_group_ids\\\":[1121],\\\"user_name\\\":\\\"John\\\",\\\"user_email\\\":\\\"abc@gmail.com\\\",\\\"user_phone\\\":\\\"123-456-7890\\\",\\\"user_access_group_ids\\\":\\\"17,18\\\",\\\"user_operator_level_id\\\":0,\\\"user_department\\\":\\\"Engineering\\\",\\\"user_title\\\":\\\"Manager\\\",\\\"user_card\\\":\\\"123456\\\",\\\"user_custom_field_1\\\":\\\"string\\\",\\\"user_custom_field_2\\\":\\\"string\\\",\\\"user_custom_field_3\\\":\\\"string\\\",\\\"user_custom_field_4\\\":\\\"string\\\",\\\"user_custom_field_5\\\":\\\"string\\\",\\\"user_custom_field_6\\\":\\\"string\\\",\\\"user_custom_field_7\\\":\\\"string\\\",\\\"user_custom_field_8\\\":\\\"string\\\",\\\"user_custom_field_9\\\":\\\"string\\\",\\\"user_custom_field_10\\\":\\\"string\\\",\\\"user_status\\\":false}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users?adv=mode1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test
            2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"User": @{ @"start_datetime":
            @"2001-01-02T00:00:00.00Z", @"expiry_datetime":
            @"2035-12-31T23:59:00.00Z", @"disabled": @YES, @"user_group_id": @{
            @"id": @242894, @"name": @"test 2", @"parent_id": @{ @"id": @1 } },
            @"permission": @{ @"id": @2 }, @"access_groups": @[ @{ @"id": @"14"
            } ] },
                                          @"adv_criteria": @{ @"limit": @50, @"offset": @0, @"user_id": @"11", @"order_by": @"user_id:false", @"user_group_id": @1, @"user_group_ids": @[ @1121 ], @"user_name": @"John", @"user_email": @"abc@gmail.com", @"user_phone": @"123-456-7890", @"user_access_group_ids": @"17,18", @"user_operator_level_id": @0, @"user_department": @"Engineering", @"user_title": @"Manager", @"user_card": @"123456", @"user_custom_field_1": @"string", @"user_custom_field_2": @"string", @"user_custom_field_3": @"string", @"user_custom_field_4": @"string", @"user_custom_field_5": @"string", @"user_custom_field_6": @"string", @"user_custom_field_7": @"string", @"user_custom_field_8": @"string", @"user_custom_field_9": @"string", @"user_custom_field_10": @"string", @"user_status": @NO } };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users?adv=mode1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "User": [
                "start_datetime": "2001-01-02T00:00:00.00Z",
                "expiry_datetime": "2035-12-31T23:59:00.00Z",
                "disabled": true,
                "user_group_id": [
                  "id": 242894,
                  "name": "test 2",
                  "parent_id": ["id": 1]
                ],
                "permission": ["id": 2],
                "access_groups": [["id": "14"]]
              ],
              "adv_criteria": [
                "limit": 50,
                "offset": 0,
                "user_id": "11",
                "order_by": "user_id:false",
                "user_group_id": 1,
                "user_group_ids": [1121],
                "user_name": "John",
                "user_email": "abc@gmail.com",
                "user_phone": "123-456-7890",
                "user_access_group_ids": "17,18",
                "user_operator_level_id": 0,
                "user_department": "Engineering",
                "user_title": "Manager",
                "user_card": "123456",
                "user_custom_field_1": "string",
                "user_custom_field_2": "string",
                "user_custom_field_3": "string",
                "user_custom_field_4": "string",
                "user_custom_field_5": "string",
                "user_custom_field_6": "string",
                "user_custom_field_7": "string",
                "user_custom_field_8": "string",
                "user_custom_field_9": "string",
                "user_custom_field_10": "string",
                "user_status": false
              ]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users?adv=mode1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users?adv=mode1");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test
            2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/users?adv=mode1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test 2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users?adv=mode1' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"User":{"start_datetime":"2001-01-02T00:00:00.00Z","expiry_datetime":"2035-12-31T23:59:00.00Z","disabled":true,"user_group_id":{"id":242894,"name":"test
            2","parent_id":{"id":1}},"permission":{"id":2},"access_groups":[{"id":"14"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users?adv=mode1' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"User":{"start_datetime":"2001-01-02T00:00:00.00Z","expiry_datetime":"2035-12-31T23:59:00.00Z","disabled":true,"user_group_id":{"id":242894,"name":"test
            2","parent_id":{"id":1}},"permission":{"id":2},"access_groups":[{"id":"14"}]},"adv_criteria":{"limit":50,"offset":0,"user_id":"11","order_by":"user_id:false","user_group_id":1,"user_group_ids":[1121],"user_name":"John","user_email":"abc@gmail.com","user_phone":"123-456-7890","user_access_group_ids":"17,18","user_operator_level_id":0,"user_department":"Engineering","user_title":"Manager","user_card":"123456","user_custom_field_1":"string","user_custom_field_2":"string","user_custom_field_3":"string","user_custom_field_4":"string","user_custom_field_5":"string","user_custom_field_6":"string","user_custom_field_7":"string","user_custom_field_8":"string","user_custom_field_9":"string","user_custom_field_10":"string","user_status":false}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users"


            queryString <- list([ 'adv' ] = "mode1")


            payload <-
            "{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test
            2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/users?adv=mode1" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test
            2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"User\":{\"start_datetime\":\"2001-01-02T00:00:00.00Z\",\"expiry_datetime\":\"2035-12-31T23:59:00.00Z\",\"disabled\":true,\"user_group_id\":{\"id\":242894,\"name\":\"test
            2\",\"parent_id\":{\"id\":1}},\"permission\":{\"id\":2},\"access_groups\":[{\"id\":\"14\"}]},\"adv_criteria\":{\"limit\":50,\"offset\":0,\"user_id\":\"11\",\"order_by\":\"user_id:false\",\"user_group_id\":1,\"user_group_ids\":[1121],\"user_name\":\"John\",\"user_email\":\"abc@gmail.com\",\"user_phone\":\"123-456-7890\",\"user_access_group_ids\":\"17,18\",\"user_operator_level_id\":0,\"user_department\":\"Engineering\",\"user_title\":\"Manager\",\"user_card\":\"123456\",\"user_custom_field_1\":\"string\",\"user_custom_field_2\":\"string\",\"user_custom_field_3\":\"string\",\"user_custom_field_4\":\"string\",\"user_custom_field_5\":\"string\",\"user_custom_field_6\":\"string\",\"user_custom_field_7\":\"string\",\"user_custom_field_8\":\"string\",\"user_custom_field_9\":\"string\",\"user_custom_field_10\":\"string\",\"user_status\":false}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/users?adv=mode1")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - User
      summary: List All User
      operationId: listUser
      description: >-
        This API is used to list users which is recorded on BioStar X.


        **Known errors:**


        - Putting "/" at the end of the endpoint

        - Using `group_id` which doesn't exist will return success but no
        records


        **Note**: This API is deprecated in BioStar 2 v2.8.12, please use
        `/api/v2/users/search` instead.
      parameters:
        - name: group_id
          in: query
          schema:
            type: integer
          description: >-
            Filter response record(s) according to the group_id specified on
            this parameter. Use GET /api/user_groups to list all User Groups.
            Default value: 1 to show all.
          example: 1
        - name: limit
          in: query
          schema:
            type: integer
          description: >-
            Limit response record(s) by the amount specified on this parameter.
            0 for show all.
          example: 0
        - name: offset
          in: query
          schema:
            type: integer
          description: >-
            Shift response record(s) by the amount specified on this parameter.
            default value = 0. Ex: If you have 10 records, put value 5 on limit,
            and when you put value 5 on offset, you will get record 6 to 10 on
            the result.
          example: 0
        - name: order_by
          in: query
          schema:
            type: string
          description: >-
            Order the response record(s) by the User parameter such as user_id
            or name. False for ascending, True for descending.
          example: user_id:false
        - name: last_modified
          in: query
          schema:
            type: integer
          description: >-
            Show response record(s) with User last_modified value which is equal
            or greater than this parameter value.
          example: 0
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/users',
              qs: {
                group_id: '1',
                limit: '0',
                offset: '0',
                order_by: 'user_id:false',
                last_modified: '0'
              },
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/users");

            req.query({
              "group_id": "1",
              "limit": "0",
              "offset": "0",
              "order_by": "user_id:false",
              "last_modified": "0"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/users',
              params: {
                group_id: '1',
                limit: '0',
                offset: '0',
                order_by: 'user_id:false',
                last_modified: '0'
              },
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/users"


            querystring =
            {"group_id":"1","limit":"0","offset":"0","order_by":"user_id:false","last_modified":"0"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/users');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'group_id' => '1',
              'limit' => '0',
              'offset' => '0',
              'order_by' => 'user_id:false',
              'last_modified' => '0'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/users');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'group_id' => '1',
              'limit' => '0',
              'offset' => '0',
              'order_by' => 'user_id:false',
              'last_modified' => '0'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/users"


            queryString <- list(
              group_id = "1",
              limit = "0",
              offset = "0",
              order_by = "user_id:false"
              last_modified = "0",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/users?group_id=1&limit=0&offset=0&order_by=user_id%3Afalse&last_modified=0")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/clear_alarm:
    post:
      tags:
        - Device
      summary: Clear Device Alarm
      operationId: createDeviceClearAlarm
      description: This API is used to clear alarm from a device.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DeviceCollection:
                  type: object
                  properties:
                    rows:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 542353521
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/devices/clear_alarm \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DeviceCollection":{"rows":[{"id":542353521}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"DeviceCollection":{"rows":[{"id":542353521}]}}' |  \
              http POST https://{baseurl}/api/devices/clear_alarm \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DeviceCollection":{"rows":[{"id":542353521}]}}' \
              --output-document \
              - https://{baseurl}/api/devices/clear_alarm
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/clear_alarm",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({DeviceCollection: {rows: [{id:
            542353521}]}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/clear_alarm',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DeviceCollection: {rows: [{id: 542353521}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/clear_alarm");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": 542353521
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/clear_alarm',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DeviceCollection: {rows: [{id: 542353521}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/devices/clear_alarm';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":542353521}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DeviceCollection":{"rows":[{"id":542353521}]}}'
            };

            fetch('https://{baseurl}/api/devices/clear_alarm', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/clear_alarm",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DeviceCollection": {
                "rows": [
                  {
                    "id": 542353521
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/devices/clear_alarm");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/devices/clear_alarm", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/clear_alarm"


            payload = {"DeviceCollection": {"rows": [{"id": 542353521}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/devices/clear_alarm")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/clear_alarm",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/clear_alarm');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"DeviceCollection":{"rows":[{"id":542353521}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"DeviceCollection":{"rows":[{"id":542353521}]}}');


            $request->setRequestUrl('https://{baseurl}/api/devices/clear_alarm');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/clear_alarm")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/clear_alarm")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/clear_alarm\"\n\n\tpayload := strings.NewReader(\"{\\\"DeviceCollection\\\":{\\\"rows\\\":[{\\\"id\\\":542353521}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/clear_alarm");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DeviceCollection": @{ @"rows": @[ @{
            @"id": @542353521 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/clear_alarm"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DeviceCollection": ["rows": [["id": 542353521]]]]
            as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/clear_alarm")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/clear_alarm");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/clear_alarm"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/clear_alarm' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":542353521}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/clear_alarm' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DeviceCollection":{"rows":[{"id":542353521}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/clear_alarm"


            payload <- "{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/devices/clear_alarm"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DeviceCollection\":{\"rows\":[{\"id\":542353521}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/clear_alarm")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{id}/users:
    get:
      tags:
        - Device
      summary: View Total User on a Device
      operationId: listDeviceUser
      description: This API is used to view user data summary from a device.
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
          description: >-
            Limit the number of response's records by the specified value.
            (Default=`50`)
          example: 20
        - name: page
          in: query
          schema:
            type: integer
          description: >-
            Filter the response based on the specified page number.
            (Default=`1`)
          example: 0
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: 543308153
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/devices/543308153/users?limit=20&page=0' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/devices/543308153/users?limit=20&page=0' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/devices/543308153/users?limit=20&page=0'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/543308153/users?limit=20&page=0",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/543308153/users',
              qs: {limit: '20', page: '0'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/devices/543308153/users");


            req.query({
              "limit": "20",
              "page": "0"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/543308153/users',
              params: {limit: '20', page: '0'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/devices/543308153/users?limit=20&page=0';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/543308153/users?limit=20&page=0',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/543308153/users?limit=20&page=0",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/devices/543308153/users?limit=20&page=0");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/devices/543308153/users?limit=20&page=0",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/543308153/users"


            querystring = {"limit":"20","page":"0"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/devices/543308153/users?limit=20&page=0")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/543308153/users?limit=20&page=0",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/devices/543308153/users');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => '20',
              'page' => '0'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/543308153/users');

            $request->setRequestMethod('GET');

            $request->setQuery(new http\QueryString([
              'limit' => '20',
              'page' => '0'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/543308153/users?limit=20&page=0")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/devices/543308153/users?limit=20&page=0")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/543308153/users?limit=20&page=0\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/543308153/users?limit=20&page=0");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/543308153/users?limit=20&page=0"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/543308153/users?limit=20&page=0")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/543308153/users?limit=20&page=0");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/devices/543308153/users?limit=20&page=0"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/543308153/users?limit=20&page=0'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/543308153/users?limit=20&page=0'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/543308153/users"


            queryString <- list(
              limit = "20"
              page = "0",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/543308153/users?limit=20&page=0" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/543308153/users?limit=20&page=0")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Device
      summary: Delete User from a Device
      operationId: deleteDeviceUser
      description: This API is used to delete user data on a device.
      parameters:
        - name: id
          in: query
          schema:
            type: string
          description: ID of the user which will be deleted. Use (*) for all user.
          example: '*'
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device which the user data will be deleted
          example: 543720368
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/devices/543720368/users?id=*' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE 'https://{baseurl}/api/devices/543720368/users?id=*' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/devices/543720368/users?id=*'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/543720368/users?id=*",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/devices/543720368/users',
              qs: {id: '*'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/devices/543720368/users");


            req.query({
              "id": "*"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/devices/543720368/users',
              params: {id: '*'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices/543720368/users?id=*';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/543720368/users?id=*', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/543720368/users?id=*",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("DELETE",
            "https://{baseurl}/api/devices/543720368/users?id=*");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/devices/543720368/users?id=*",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/543720368/users"


            querystring = {"id":"*"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/543720368/users?id=*")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/543720368/users?id=*",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/devices/543720368/users');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => '*'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/543720368/users');

            $request->setRequestMethod('DELETE');

            $request->setQuery(new http\QueryString([
              'id' => '*'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/543720368/users?id=*")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/devices/543720368/users?id=*")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/543720368/users?id=*\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/543720368/users?id=*");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/543720368/users?id=*"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/543720368/users?id=*")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/543720368/users?id=*");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/devices/543720368/users?id=*"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/543720368/users?id=*' -Method DELETE
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/543720368/users?id=*' -Method DELETE
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/543720368/users"


            queryString <- list([ 'id' ] = "*")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/543720368/users?id=*" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/543720368/users?id=*")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/{id}/users/export:
    post:
      tags:
        - Device
      summary: Export User Data from a Device to BioStar X
      operationId: exportDeviceUserExport
      description: This API is used to export user data from a device to BioStar X.
      requestBody:
        content: {}
      parameters:
        - name: id
          in: query
          schema:
            type: integer
          description: >-
            ID of the user which will be uploaded. Use plus symbol ( + ) to
            separate multiple user ID, ex: 1+2+3.
          example: 44004
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device which the user data will be uploaded to.
          example: 538152248
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  UserCollection:
                    $ref: '#/components/schemas/UserCollection'
                  DeviceResponse:
                    $ref: '#/components/schemas/DeviceResponse'
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
                example:
                  UserCollection:
                    total: '0'
                    rows:
                      - user_id: '44004'
                        name: John Doe
                        updated_count: '2'
                        disabled: false
                        flag: '1'
                        cards_count: '0'
                        fingerprint_templates_count: '0'
                        face_count: '1'
                        start_datetime: '2001-01-01T00:00:00.00Z'
                        expiry_datetime: '2030-12-31T23:59:00.00Z'
                        security_level: '0'
                        private_operation_modes: ''
                        credentials:
                          visualFaces:
                            - template_ex_normalized_image: /9j/4AAQSkZJRgABAQAAAQABAAD...
                              index: '0'
                              template:
                                - template_ex: >-
                                    AAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3hoF9....
                                  credential_bin_type: '5'
                                - template_ex: >-
                                    AAADABEBywGIALIAZAcF/SBiVHcAAJkAAAAAAAAAAAB5h399....
                                  credential_bin_type: '5'
                                - template_ex: >-
                                    AAADAOcAyQGJALAAZA4J9ChYNXkAAJMAAAAAAAAAAAB3h4B+g4B....
                                  credential_bin_type: '5'
                                - template_ex: >-
                                    AAADAOEAfAGyANsAY+j+DStRTmQAAIcAAAAAAAAAAAB1h39+f3....
                                  credential_bin_type: '5'
                              flag: '1'
                  DeviceResponse:
                    rows:
                      - id: '538152248'
                        code: '0'
                    result: 'true'
                  Response:
                    code: '0'
                    link: https://support.supremainc.com/en/support/home
                    message: Success
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/devices/538152248/users/export?id=44004' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http POST
            'https://{baseurl}/api/devices/538152248/users/export?id=44004' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/devices/538152248/users/export?id=44004'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/538152248/users/export?id=44004",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/538152248/users/export',
              qs: {id: '44004'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/devices/538152248/users/export");


            req.query({
              "id": "44004"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/devices/538152248/users/export',
              params: {id: '44004'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/devices/538152248/users/export?id=44004';


            let options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'POST', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/538152248/users/export?id=44004',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/538152248/users/export?id=44004",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/devices/538152248/users/export?id=44004");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("POST",
            "{baseurl}/api/devices/538152248/users/export?id=44004",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/devices/538152248/users/export"


            querystring = {"id":"44004"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("POST", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/devices/538152248/users/export?id=44004")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/538152248/users/export?id=44004",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/devices/538152248/users/export');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'id' => '44004'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/538152248/users/export');

            $request->setRequestMethod('POST');

            $request->setQuery(new http\QueryString([
              'id' => '44004'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/538152248/users/export?id=44004")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/devices/538152248/users/export?id=44004")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/538152248/users/export?id=44004\"\n\n\treq, _ := http.NewRequest(\"POST\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/538152248/users/export?id=44004");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/538152248/users/export?id=44004"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/538152248/users/export?id=44004")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/538152248/users/export?id=44004");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/devices/538152248/users/export?id=44004"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/538152248/users/export?id=44004'
            -Method POST -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/538152248/users/export?id=44004'
            -Method POST -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/538152248/users/export"


            queryString <- list([ 'id' ] = "44004")


            response <- VERB("POST", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/538152248/users/export?id=44004" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/538152248/users/export?id=44004")
              .post(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/devices/rs485/{dev_id}:
    get:
      tags:
        - Device
      summary: View RS485 Devices
      operationId: getDeviceRs485
      description: This API is used to list devices which connected using RS-485.
      parameters:
        - name: dev_id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the device which will be viewed
          example: 542071155
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/devices/rs485/542071155 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/devices/rs485/542071155 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/devices/rs485/542071155
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/devices/rs485/542071155",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/rs485/542071155',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/devices/rs485/542071155");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/devices/rs485/542071155',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/devices/rs485/542071155';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/devices/rs485/542071155', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/devices/rs485/542071155",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/devices/rs485/542071155");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/devices/rs485/542071155",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/devices/rs485/542071155"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/devices/rs485/542071155")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/devices/rs485/542071155",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/devices/rs485/542071155');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/devices/rs485/542071155');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/devices/rs485/542071155")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/devices/rs485/542071155")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/devices/rs485/542071155\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/devices/rs485/542071155");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/devices/rs485/542071155"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/devices/rs485/542071155")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/devices/rs485/542071155");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/devices/rs485/542071155"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/devices/rs485/542071155' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/devices/rs485/542071155' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/devices/rs485/542071155"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/devices/rs485/542071155" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/devices/rs485/542071155")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/door_groups/search:
    post:
      tags:
        - Door Groups
      summary: View All Door Groups
      operationId: searchDoorGroupsearch
      description: >-
        This API is used to view all available door groups.

        It is required to put {} on the body parameter to run the API
        successfully.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example: {}
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/door_groups/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{}' |  \
              http POST https://{baseurl}/api/v2/door_groups/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{}' \
              --output-document \
              - https://{baseurl}/api/v2/door_groups/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/door_groups/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/door_groups/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/door_groups/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({});


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/door_groups/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/door_groups/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{}'
            };

            fetch('https://{baseurl}/api/v2/door_groups/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/door_groups/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({});

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/door_groups/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/door_groups/search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/door_groups/search"


            payload = {}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/door_groups/search")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/door_groups/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/door_groups/search');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{}');


            $request->setRequestUrl('https://{baseurl}/api/v2/door_groups/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            MediaType mediaType = MediaType.parse("application/json");
            RequestBody body = RequestBody.create(mediaType, "{}");
            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/door_groups/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/door_groups/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/door_groups/search\"\n\n\tpayload := strings.NewReader(\"{}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/door_groups/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{  };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/door_groups/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/door_groups/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/door_groups/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json", "{}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/door_groups/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/door_groups/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body '{}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/door_groups/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body '{}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/door_groups/search"


            payload <- "{}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/door_groups/search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string "{}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val mediaType = MediaType.parse("application/json")
            val body = RequestBody.create(mediaType, "{}")
            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/door_groups/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/door_groups/only_permission_item/search:
    post:
      tags:
        - Door Groups
      summary: View All Door Groups (Sort)
      operationId: searchDoorGrouponlyPermissionItemsearch
      description: >-
        This API is used to view all door groups while sorting the response
        using available fields.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                order_by:
                  type: string
                  description: >-
                    Sort the response records by value which inputted on this
                    parameter

                    Available fields: `id`, `name`, `depth`
                  example: depth:false
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/door_groups/only_permission_item/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"order_by":"depth:false"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"order_by":"depth:false"}' |  \
              http POST https://{baseurl}/api/v2/door_groups/only_permission_item/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"order_by":"depth:false"}' \
              --output-document \
              - https://{baseurl}/api/v2/door_groups/only_permission_item/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/door_groups/only_permission_item/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({order_by: 'depth:false'}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/door_groups/only_permission_item/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {order_by: 'depth:false'},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/door_groups/only_permission_item/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "order_by": "depth:false"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/door_groups/only_permission_item/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {order_by: 'depth:false'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/door_groups/only_permission_item/search';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"order_by":"depth:false"}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"order_by":"depth:false"}'
            };


            fetch('https://{baseurl}/api/v2/door_groups/only_permission_item/search',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/door_groups/only_permission_item/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"order_by\":\"depth:false\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "order_by": "depth:false"
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/v2/door_groups/only_permission_item/search");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"order_by\":\"depth:false\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/v2/door_groups/only_permission_item/search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url =
            "https://{baseurl}/api/v2/door_groups/only_permission_item/search"


            payload = {"order_by": "depth:false"}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/door_groups/only_permission_item/search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"order_by\":\"depth:false\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/door_groups/only_permission_item/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"order_by\":\"depth:false\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/door_groups/only_permission_item/search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"order_by":"depth:false"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"order_by":"depth:false"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/door_groups/only_permission_item/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"order_by\":\"depth:false\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/door_groups/only_permission_item/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/door_groups/only_permission_item/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"order_by\":\"depth:false\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/door_groups/only_permission_item/search\"\n\n\tpayload := strings.NewReader(\"{\\\"order_by\\\":\\\"depth:false\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/door_groups/only_permission_item/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"order_by\":\"depth:false\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"order_by": @"depth:false" };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/door_groups/only_permission_item/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["order_by": "depth:false"] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/door_groups/only_permission_item/search")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/door_groups/only_permission_item/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"order_by\":\"depth:false\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/door_groups/only_permission_item/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"order_by\":\"depth:false\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/door_groups/only_permission_item/search'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"order_by":"depth:false"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/door_groups/only_permission_item/search'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"order_by":"depth:false"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <-
            "https://{baseurl}/api/v2/door_groups/only_permission_item/search"


            payload <- "{\"order_by\":\"depth:false\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/door_groups/only_permission_item/search"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"order_by\":\"depth:false\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"order_by\":\"depth:false\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/door_groups/only_permission_item/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/door_groups:
    post:
      tags:
        - Door Groups
      summary: Create Door Group
      operationId: createDoorGroup
      description: >-
        This API is used to create door groups.

        **Known issue:**

        - Duplicate group name within one parent group
            
        - Depth value not within 1-8
            
        - Using `parent_id` which doesn't exist will result in success but the
        created group will not be visible.
            
        - Using empty value on name will success creating a door with name:
        undefined. This door can't be deleted. To resolve this, update the door
        name then it will be able to be deleted.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DoorGroup:
                  type: object
                  required:
                    - parent_id
                    - depth
                    - name
                  properties:
                    parent_id:
                      type: object
                      required:
                        - id
                      properties:
                        id:
                          type: integer
                          description: ID of the parent group
                          example: 47
                    depth:
                      type: integer
                      description: >-
                        Depth of the group in accordance with the parent group
                        (parent depth+1). Value between 1 to 8.
                      example: 1
                    name:
                      type: string
                      description: >-
                        Name of the group. Do not put empty value on this
                        parameter. Max 48 characters.
                      example: AAAAA5q
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/door_groups \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DoorGroup":{"parent_id":{"id":47},"depth":1,"name":"AAAAA5q"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"DoorGroup":{"parent_id":{"id":47},"depth":1,"name":"AAAAA5q"}}'
            |  \
              http POST https://{baseurl}/api/door_groups \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DoorGroup":{"parent_id":{"id":47},"depth":1,"name":"AAAAA5q"}}' \
              --output-document \
              - https://{baseurl}/api/door_groups
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/door_groups",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({DoorGroup: {parent_id: {id: 47}, depth: 1,
            name: 'AAAAA5q'}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/door_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DoorGroup: {parent_id: {id: 47}, depth: 1, name: 'AAAAA5q'}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/door_groups");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DoorGroup": {
                "parent_id": {
                  "id": 47
                },
                "depth": 1,
                "name": "AAAAA5q"
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/door_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DoorGroup: {parent_id: {id: 47}, depth: 1, name: 'AAAAA5q'}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/door_groups';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorGroup":{"parent_id":{"id":47},"depth":1,"name":"AAAAA5q"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorGroup":{"parent_id":{"id":47},"depth":1,"name":"AAAAA5q"}}'
            };

            fetch('https://{baseurl}/api/door_groups', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/door_groups",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DoorGroup": {
                "parent_id": {
                  "id": 47
                },
                "depth": 1,
                "name": "AAAAA5q"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/door_groups");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/door_groups", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/door_groups"


            payload = {"DoorGroup": {
                    "parent_id": {"id": 47},
                    "depth": 1,
                    "name": "AAAAA5q"
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/door_groups")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/door_groups",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/door_groups');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"DoorGroup":{"parent_id":{"id":47},"depth":1,"name":"AAAAA5q"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"DoorGroup":{"parent_id":{"id":47},"depth":1,"name":"AAAAA5q"}}');


            $request->setRequestUrl('https://{baseurl}/api/door_groups');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/door_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/door_groups")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/door_groups\"\n\n\tpayload := strings.NewReader(\"{\\\"DoorGroup\\\":{\\\"parent_id\\\":{\\\"id\\\":47},\\\"depth\\\":1,\\\"name\\\":\\\"AAAAA5q\\\"}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/door_groups");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DoorGroup": @{ @"parent_id": @{
            @"id": @47 }, @"depth": @1, @"name": @"AAAAA5q" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/door_groups"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DoorGroup": [
                "parent_id": ["id": 47],
                "depth": 1,
                "name": "AAAAA5q"
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/door_groups")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/door_groups");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/door_groups"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/door_groups' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorGroup":{"parent_id":{"id":47},"depth":1,"name":"AAAAA5q"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/door_groups' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorGroup":{"parent_id":{"id":47},"depth":1,"name":"AAAAA5q"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/door_groups"


            payload <-
            "{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/door_groups" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DoorGroup\":{\"parent_id\":{\"id\":47},\"depth\":1,\"name\":\"AAAAA5q\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/door_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Door Groups
      summary: Delete Door Group
      operationId: deleteDoorGroup
      description: >-
        This API is used to delete door group.


        Put the door's ID on the id parameters of this API to delete door.


        **Note:**

        - Deleting parent group will also delete child group
            
        - Deleting groups with door(s) will also remove door(s) under that
        group. This will consequently remove doors from Access Levels
            
        - Can't delete groups with `parent_id` which doesn't exist
            
        - Can't delete groups with undefined name
      parameters:
        - name: id
          in: query
          schema:
            type: integer
          description: ID of the door which will be deleted
          example: 33
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/door_groups?id=33' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE 'https://{baseurl}/api/door_groups?id=33' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/door_groups?id=33'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/door_groups?id=33",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/door_groups',
              qs: {id: '33'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("DELETE", "https://{baseurl}/api/door_groups");

            req.query({
              "id": "33"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/door_groups',
              params: {id: '33'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/door_groups?id=33';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/door_groups?id=33', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/door_groups?id=33",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/door_groups?id=33");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/door_groups?id=33",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/door_groups"


            querystring = {"id":"33"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/door_groups?id=33")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/door_groups?id=33",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/door_groups');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => '33'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/door_groups');
            $request->setRequestMethod('DELETE');
            $request->setQuery(new http\QueryString([
              'id' => '33'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/door_groups?id=33")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/door_groups?id=33")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/door_groups?id=33\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/door_groups?id=33");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/door_groups?id=33"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/door_groups?id=33")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/door_groups?id=33");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/door_groups?id=33"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/door_groups?id=33' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/door_groups?id=33' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/door_groups"


            queryString <- list([ 'id' ] = "33")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/door_groups?id=33" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/door_groups?id=33")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/door_groups/{id}:
    put:
      tags:
        - Door Groups
      summary: Update Door Group
      operationId: updateDoorGroup
      description: |-
        This API is used to update door group.

        Put the door's ID on the id parameters of this API to update door.

        **Note:**

        - When parent_id updated, any child group will follow the parent group
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DoorGroup:
                  type: object
                  properties:
                    name:
                      type: string
                      description: >-
                        Name of the group. Do not put empty value on this
                        parameter. Max 48 characters.
                      example: New11
                    parent_id:
                      type: object
                      required:
                        - id
                      properties:
                        id:
                          type: integer
                          description: ID of the parent group
                          example: 45
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: 42
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/door_groups/42 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DoorGroup":{"name":"New11","parent_id":{"id":45}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"DoorGroup":{"name":"New11","parent_id":{"id":45}}}' |  \
              http PUT https://{baseurl}/api/door_groups/42 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DoorGroup":{"name":"New11","parent_id":{"id":45}}}' \
              --output-document \
              - https://{baseurl}/api/door_groups/42
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/door_groups/42",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({DoorGroup: {name: 'New11', parent_id: {id:
            45}}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/door_groups/42',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DoorGroup: {name: 'New11', parent_id: {id: 45}}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/door_groups/42");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DoorGroup": {
                "name": "New11",
                "parent_id": {
                  "id": 45
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/door_groups/42',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DoorGroup: {name: 'New11', parent_id: {id: 45}}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/door_groups/42';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorGroup":{"name":"New11","parent_id":{"id":45}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorGroup":{"name":"New11","parent_id":{"id":45}}}'
            };

            fetch('https://{baseurl}/api/door_groups/42', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/door_groups/42",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DoorGroup": {
                "name": "New11",
                "parent_id": {
                  "id": 45
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/door_groups/42");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/door_groups/42", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/door_groups/42"


            payload = {"DoorGroup": {
                    "name": "New11",
                    "parent_id": {"id": 45}
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/door_groups/42")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/door_groups/42",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/door_groups/42');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"DoorGroup":{"name":"New11","parent_id":{"id":45}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"DoorGroup":{"name":"New11","parent_id":{"id":45}}}');


            $request->setRequestUrl('https://{baseurl}/api/door_groups/42');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/door_groups/42")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/door_groups/42")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/door_groups/42\"\n\n\tpayload := strings.NewReader(\"{\\\"DoorGroup\\\":{\\\"name\\\":\\\"New11\\\",\\\"parent_id\\\":{\\\"id\\\":45}}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/door_groups/42");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DoorGroup": @{ @"name": @"New11",
            @"parent_id": @{ @"id": @45 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/door_groups/42"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DoorGroup": [
                "name": "New11",
                "parent_id": ["id": 45]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/door_groups/42")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/door_groups/42");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/door_groups/42"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/door_groups/42' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorGroup":{"name":"New11","parent_id":{"id":45}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/door_groups/42' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorGroup":{"name":"New11","parent_id":{"id":45}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/door_groups/42"


            payload <-
            "{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/door_groups/42" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}" in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DoorGroup\":{\"name\":\"New11\",\"parent_id\":{\"id\":45}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/door_groups/42")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/doors/{id}:
    get:
      tags:
        - Doors
      summary: View a Door Details
      operationId: listDoor
      description: This API is used to view a Door details.
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the door which will be viewed
          example: '1'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/doors/1 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/doors/1 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/doors/1
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors/1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/doors/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/doors/1");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/doors/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/doors/1';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/doors/1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors/1",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/doors/1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/doors/1", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/doors/1"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/doors/1")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors/1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/doors/1');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/doors/1');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/doors/1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors/1\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL, "https://{baseurl}/api/doors/1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors/1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors/1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/doors/1");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/doors/1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/doors/1'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/doors/1'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors/1"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors/1" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    put:
      tags:
        - Doors
      summary: Update a Door
      operationId: updateDoor
      description: |-
        This API is used to update a Door details.

        Leave the values to be edited, and remove everything else.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Door:
                  $ref: '#/components/schemas/Door'
              example:
                Door:
                  name: Anywhere FS2
                  description: Test
                  door_group_id:
                    id: 1
                  open_timeout: 15
                  open_duration: 5
                  open_once: true
                  unconditional_lock: true
                  entry_device_id:
                    id: 542353521
                  relay_output_id:
                    device_id:
                      id: 542353521
                    relay_index: 0
                  exit_button_input_id:
                    device_id:
                      id: 542353521
                    input_index: 0
                    type: 1
                  sensor_input_id:
                    device_id:
                      id: 542353521
                    input_index: 1
                    type: 1
                    apb_use_door_sensor: 1
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the door which will be updated
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/doors/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Door":{"name":"Anywhere FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"Door":{"name":"Anywhere
            FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
            |  \
              http PUT https://{baseurl}/api/doors/{id} \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Door":{"name":"Anywhere FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}' \
              --output-document \
              - https://{baseurl}/api/doors/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Door: {
                name: 'Anywhere FS2',
                description: 'Test',
                door_group_id: {id: 1},
                open_timeout: 15,
                open_duration: 5,
                open_once: true,
                unconditional_lock: true,
                entry_device_id: {id: 542353521},
                relay_output_id: {device_id: {id: 542353521}, relay_index: 0},
                exit_button_input_id: {device_id: {id: 542353521}, input_index: 0, type: 1},
                sensor_input_id: {device_id: {id: 542353521}, input_index: 1, type: 1, apb_use_door_sensor: 1}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/doors/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Door: {
                  name: 'Anywhere FS2',
                  description: 'Test',
                  door_group_id: {id: 1},
                  open_timeout: 15,
                  open_duration: 5,
                  open_once: true,
                  unconditional_lock: true,
                  entry_device_id: {id: 542353521},
                  relay_output_id: {device_id: {id: 542353521}, relay_index: 0},
                  exit_button_input_id: {device_id: {id: 542353521}, input_index: 0, type: 1},
                  sensor_input_id: {device_id: {id: 542353521}, input_index: 1, type: 1, apb_use_door_sensor: 1}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/doors/{id}");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Door": {
                "name": "Anywhere FS2",
                "description": "Test",
                "door_group_id": {
                  "id": 1
                },
                "open_timeout": 15,
                "open_duration": 5,
                "open_once": true,
                "unconditional_lock": true,
                "entry_device_id": {
                  "id": 542353521
                },
                "relay_output_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "relay_index": 0
                },
                "exit_button_input_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "input_index": 0,
                  "type": 1
                },
                "sensor_input_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "input_index": 1,
                  "type": 1,
                  "apb_use_door_sensor": 1
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/doors/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Door: {
                  name: 'Anywhere FS2',
                  description: 'Test',
                  door_group_id: {id: 1},
                  open_timeout: 15,
                  open_duration: 5,
                  open_once: true,
                  unconditional_lock: true,
                  entry_device_id: {id: 542353521},
                  relay_output_id: {device_id: {id: 542353521}, relay_index: 0},
                  exit_button_input_id: {device_id: {id: 542353521}, input_index: 0, type: 1},
                  sensor_input_id: {device_id: {id: 542353521}, input_index: 1, type: 1, apb_use_door_sensor: 1}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/doors/{id}';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Door":{"name":"Anywhere FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Door":{"name":"Anywhere FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
            };

            fetch('https://{baseurl}/api/doors/{id}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors/{id}",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Door\":{\"name\":\"Anywhere FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Door": {
                "name": "Anywhere FS2",
                "description": "Test",
                "door_group_id": {
                  "id": 1
                },
                "open_timeout": 15,
                "open_duration": 5,
                "open_once": true,
                "unconditional_lock": true,
                "entry_device_id": {
                  "id": 542353521
                },
                "relay_output_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "relay_index": 0
                },
                "exit_button_input_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "input_index": 0,
                  "type": 1
                },
                "sensor_input_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "input_index": 1,
                  "type": 1,
                  "apb_use_door_sensor": 1
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/doors/{id}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/doors/{id}", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors/{id}"


            payload = {"Door": {
                    "name": "Anywhere FS2",
                    "description": "Test",
                    "door_group_id": {"id": 1},
                    "open_timeout": 15,
                    "open_duration": 5,
                    "open_once": True,
                    "unconditional_lock": True,
                    "entry_device_id": {"id": 542353521},
                    "relay_output_id": {
                        "device_id": {"id": 542353521},
                        "relay_index": 0
                    },
                    "exit_button_input_id": {
                        "device_id": {"id": 542353521},
                        "input_index": 0,
                        "type": 1
                    },
                    "sensor_input_id": {
                        "device_id": {"id": 542353521},
                        "input_index": 1,
                        "type": 1,
                        "apb_use_door_sensor": 1
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/doors/{id}")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"Door\":{\"name\":\"Anywhere FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/doors/{id}');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Door":{"name":"Anywhere
            FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Door":{"name":"Anywhere
            FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}');


            $request->setRequestUrl('https://{baseurl}/api/doors/{id}');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/doors/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Door\":{\"name\":\"Anywhere FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors/{id}\"\n\n\tpayload := strings.NewReader(\"{\\\"Door\\\":{\\\"name\\\":\\\"Anywhere FS2\\\",\\\"description\\\":\\\"Test\\\",\\\"door_group_id\\\":{\\\"id\\\":1},\\\"open_timeout\\\":15,\\\"open_duration\\\":5,\\\"open_once\\\":true,\\\"unconditional_lock\\\":true,\\\"entry_device_id\\\":{\\\"id\\\":542353521},\\\"relay_output_id\\\":{\\\"device_id\\\":{\\\"id\\\":542353521},\\\"relay_index\\\":0},\\\"exit_button_input_id\\\":{\\\"device_id\\\":{\\\"id\\\":542353521},\\\"input_index\\\":0,\\\"type\\\":1},\\\"sensor_input_id\\\":{\\\"device_id\\\":{\\\"id\\\":542353521},\\\"input_index\\\":1,\\\"type\\\":1,\\\"apb_use_door_sensor\\\":1}}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Door": @{ @"name": @"Anywhere FS2",
            @"description": @"Test", @"door_group_id": @{ @"id": @1 },
            @"open_timeout": @15, @"open_duration": @5, @"open_once": @YES,
            @"unconditional_lock": @YES, @"entry_device_id": @{ @"id":
            @542353521 }, @"relay_output_id": @{ @"device_id": @{ @"id":
            @542353521 }, @"relay_index": @0 }, @"exit_button_input_id": @{
            @"device_id": @{ @"id": @542353521 }, @"input_index": @0, @"type":
            @1 }, @"sensor_input_id": @{ @"device_id": @{ @"id": @542353521 },
            @"input_index": @1, @"type": @1, @"apb_use_door_sensor": @1 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Door": [
                "name": "Anywhere FS2",
                "description": "Test",
                "door_group_id": ["id": 1],
                "open_timeout": 15,
                "open_duration": 5,
                "open_once": true,
                "unconditional_lock": true,
                "entry_device_id": ["id": 542353521],
                "relay_output_id": [
                  "device_id": ["id": 542353521],
                  "relay_index": 0
                ],
                "exit_button_input_id": [
                  "device_id": ["id": 542353521],
                  "input_index": 0,
                  "type": 1
                ],
                "sensor_input_id": [
                  "device_id": ["id": 542353521],
                  "input_index": 1,
                  "type": 1,
                  "apb_use_door_sensor": 1
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/doors/{id}");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/doors/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Door\":{\"name\":\"Anywhere FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors/{id}' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body '{"Door":{"name":"Anywhere
            FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors/{id}' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body '{"Door":{"name":"Anywhere
            FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors/{id}"


            payload <- "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors/{id}" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/doors:
    get:
      tags:
        - Doors
      summary: View All Doors
      operationId: viewAllDoors
      description: This API is used to view Doors which is recorded on BioStar 2 database.
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
          description: Limit the number of records according with the value specified
          example: 0
        - name: order_by
          in: query
          schema:
            type: string
          description: >-
            Sort the records based on the id, toggle true/false to switch
            asceding/descending
          example: id:true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET 'https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors?limit=0&order_by=id%3Atrue",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/doors',
              qs: {limit: '0', order_by: 'id:true'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/doors");

            req.query({
              "limit": "0",
              "order_by": "id:true"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/doors',
              params: {limit: '0', order_by: 'id:true'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/doors?limit=0&order_by=id%3Atrue", headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors"


            querystring = {"limit":"0","order_by":"id:true"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/doors');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => '0',
              'order_by' => 'id:true'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/doors');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'limit' => '0',
              'order_by' => 'id:true'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors"


            queryString <- list(
              limit = "0"
              order_by = "id:true",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors?limit=0&order_by=id%3Atrue")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Doors
      summary: Create a Door
      operationId: createDoor
      description: This API is used to create a door.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Door:
                  $ref: '#/components/schemas/Door'
              example:
                Door:
                  name: Anywhere FS2
                  description: Test
                  door_group_id:
                    id: 1
                  open_timeout: 15
                  open_duration: 5
                  open_once: true
                  unconditional_lock: true
                  entry_device_id:
                    id: 542353521
                  relay_output_id:
                    device_id:
                      id: 542353521
                    relay_index: 0
                  exit_button_input_id:
                    device_id:
                      id: 542353521
                    input_index: 0
                    type: 1
                  sensor_input_id:
                    device_id:
                      id: 542353521
                    input_index: 1
                    type: 1
                    apb_use_door_sensor: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/doors \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Door":{"name":"Anywhere FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"Door":{"name":"Anywhere
            FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
            |  \
              http POST https://{baseurl}/api/doors \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Door":{"name":"Anywhere FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}' \
              --output-document \
              - https://{baseurl}/api/doors
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Door: {
                name: 'Anywhere FS2',
                description: 'Test',
                door_group_id: {id: 1},
                open_timeout: 15,
                open_duration: 5,
                open_once: true,
                unconditional_lock: true,
                entry_device_id: {id: 542353521},
                relay_output_id: {device_id: {id: 542353521}, relay_index: 0},
                exit_button_input_id: {device_id: {id: 542353521}, input_index: 0, type: 1},
                sensor_input_id: {device_id: {id: 542353521}, input_index: 1, type: 1, apb_use_door_sensor: 1}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Door: {
                  name: 'Anywhere FS2',
                  description: 'Test',
                  door_group_id: {id: 1},
                  open_timeout: 15,
                  open_duration: 5,
                  open_once: true,
                  unconditional_lock: true,
                  entry_device_id: {id: 542353521},
                  relay_output_id: {device_id: {id: 542353521}, relay_index: 0},
                  exit_button_input_id: {device_id: {id: 542353521}, input_index: 0, type: 1},
                  sensor_input_id: {device_id: {id: 542353521}, input_index: 1, type: 1, apb_use_door_sensor: 1}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/doors");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Door": {
                "name": "Anywhere FS2",
                "description": "Test",
                "door_group_id": {
                  "id": 1
                },
                "open_timeout": 15,
                "open_duration": 5,
                "open_once": true,
                "unconditional_lock": true,
                "entry_device_id": {
                  "id": 542353521
                },
                "relay_output_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "relay_index": 0
                },
                "exit_button_input_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "input_index": 0,
                  "type": 1
                },
                "sensor_input_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "input_index": 1,
                  "type": 1,
                  "apb_use_door_sensor": 1
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Door: {
                  name: 'Anywhere FS2',
                  description: 'Test',
                  door_group_id: {id: 1},
                  open_timeout: 15,
                  open_duration: 5,
                  open_once: true,
                  unconditional_lock: true,
                  entry_device_id: {id: 542353521},
                  relay_output_id: {device_id: {id: 542353521}, relay_index: 0},
                  exit_button_input_id: {device_id: {id: 542353521}, input_index: 0, type: 1},
                  sensor_input_id: {device_id: {id: 542353521}, input_index: 1, type: 1, apb_use_door_sensor: 1}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/doors';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Door":{"name":"Anywhere FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Door":{"name":"Anywhere FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
            };

            fetch('https://{baseurl}/api/doors', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Door\":{\"name\":\"Anywhere FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Door": {
                "name": "Anywhere FS2",
                "description": "Test",
                "door_group_id": {
                  "id": 1
                },
                "open_timeout": 15,
                "open_duration": 5,
                "open_once": true,
                "unconditional_lock": true,
                "entry_device_id": {
                  "id": 542353521
                },
                "relay_output_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "relay_index": 0
                },
                "exit_button_input_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "input_index": 0,
                  "type": 1
                },
                "sensor_input_id": {
                  "device_id": {
                    "id": 542353521
                  },
                  "input_index": 1,
                  "type": 1,
                  "apb_use_door_sensor": 1
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/doors");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/doors", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors"


            payload = {"Door": {
                    "name": "Anywhere FS2",
                    "description": "Test",
                    "door_group_id": {"id": 1},
                    "open_timeout": 15,
                    "open_duration": 5,
                    "open_once": True,
                    "unconditional_lock": True,
                    "entry_device_id": {"id": 542353521},
                    "relay_output_id": {
                        "device_id": {"id": 542353521},
                        "relay_index": 0
                    },
                    "exit_button_input_id": {
                        "device_id": {"id": 542353521},
                        "input_index": 0,
                        "type": 1
                    },
                    "sensor_input_id": {
                        "device_id": {"id": 542353521},
                        "input_index": 1,
                        "type": 1,
                        "apb_use_door_sensor": 1
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/doors")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Door\":{\"name\":\"Anywhere FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/doors');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Door":{"name":"Anywhere
            FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Door":{"name":"Anywhere
            FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}');


            $request->setRequestUrl('https://{baseurl}/api/doors');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/doors")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Door\":{\"name\":\"Anywhere FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors\"\n\n\tpayload := strings.NewReader(\"{\\\"Door\\\":{\\\"name\\\":\\\"Anywhere FS2\\\",\\\"description\\\":\\\"Test\\\",\\\"door_group_id\\\":{\\\"id\\\":1},\\\"open_timeout\\\":15,\\\"open_duration\\\":5,\\\"open_once\\\":true,\\\"unconditional_lock\\\":true,\\\"entry_device_id\\\":{\\\"id\\\":542353521},\\\"relay_output_id\\\":{\\\"device_id\\\":{\\\"id\\\":542353521},\\\"relay_index\\\":0},\\\"exit_button_input_id\\\":{\\\"device_id\\\":{\\\"id\\\":542353521},\\\"input_index\\\":0,\\\"type\\\":1},\\\"sensor_input_id\\\":{\\\"device_id\\\":{\\\"id\\\":542353521},\\\"input_index\\\":1,\\\"type\\\":1,\\\"apb_use_door_sensor\\\":1}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL, "https://{baseurl}/api/doors");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Door": @{ @"name": @"Anywhere FS2",
            @"description": @"Test", @"door_group_id": @{ @"id": @1 },
            @"open_timeout": @15, @"open_duration": @5, @"open_once": @YES,
            @"unconditional_lock": @YES, @"entry_device_id": @{ @"id":
            @542353521 }, @"relay_output_id": @{ @"device_id": @{ @"id":
            @542353521 }, @"relay_index": @0 }, @"exit_button_input_id": @{
            @"device_id": @{ @"id": @542353521 }, @"input_index": @0, @"type":
            @1 }, @"sensor_input_id": @{ @"device_id": @{ @"id": @542353521 },
            @"input_index": @1, @"type": @1, @"apb_use_door_sensor": @1 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL URLWithString:@"https://{baseurl}/api/doors"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Door": [
                "name": "Anywhere FS2",
                "description": "Test",
                "door_group_id": ["id": 1],
                "open_timeout": 15,
                "open_duration": 5,
                "open_once": true,
                "unconditional_lock": true,
                "entry_device_id": ["id": 542353521],
                "relay_output_id": [
                  "device_id": ["id": 542353521],
                  "relay_index": 0
                ],
                "exit_button_input_id": [
                  "device_id": ["id": 542353521],
                  "input_index": 0,
                  "type": 1
                ],
                "sensor_input_id": [
                  "device_id": ["id": 542353521],
                  "input_index": 1,
                  "type": 1,
                  "apb_use_door_sensor": 1
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/doors");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/doors"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Door\":{\"name\":\"Anywhere FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/doors'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Door":{"name":"Anywhere
            FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/doors'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Door":{"name":"Anywhere
            FS2","description":"Test","door_group_id":{"id":1},"open_timeout":15,"open_duration":5,"open_once":true,"unconditional_lock":true,"entry_device_id":{"id":542353521},"relay_output_id":{"device_id":{"id":542353521},"relay_index":0},"exit_button_input_id":{"device_id":{"id":542353521},"input_index":0,"type":1},"sensor_input_id":{"device_id":{"id":542353521},"input_index":1,"type":1,"apb_use_door_sensor":1}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors"


            payload <- "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Door\":{\"name\":\"Anywhere
            FS2\",\"description\":\"Test\",\"door_group_id\":{\"id\":1},\"open_timeout\":15,\"open_duration\":5,\"open_once\":true,\"unconditional_lock\":true,\"entry_device_id\":{\"id\":542353521},\"relay_output_id\":{\"device_id\":{\"id\":542353521},\"relay_index\":0},\"exit_button_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":0,\"type\":1},\"sensor_input_id\":{\"device_id\":{\"id\":542353521},\"input_index\":1,\"type\":1,\"apb_use_door_sensor\":1}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Doors
      summary: Delete Door(s)
      operationId: deleteDoor
      description: This API is used to delete Door(s).
      parameters:
        - name: id
          in: query
          schema:
            type: string
          description: >-
            ID of the door which will be deleted. To delete multiple doors,
            separate the IDs with space.
          example: '1'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/doors?id=1' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE 'https://{baseurl}/api/doors?id=1' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/doors?id=1'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors?id=1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/doors',
              qs: {id: '1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("DELETE", "https://{baseurl}/api/doors");

            req.query({
              "id": "1"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/doors',
              params: {id: '1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/doors?id=1';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/doors?id=1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors?id=1",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/doors?id=1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("DELETE", "{baseurl}/api/doors?id=1", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors"


            querystring = {"id":"1"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/doors?id=1")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors?id=1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/doors');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => '1'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/doors');
            $request->setRequestMethod('DELETE');
            $request->setQuery(new http\QueryString([
              'id' => '1'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors?id=1")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/doors?id=1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors?id=1\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors?id=1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors?id=1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors?id=1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/doors?id=1");
            var request = new RestRequest(Method.DELETE);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/doors?id=1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors?id=1' -Method DELETE -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors?id=1' -Method DELETE -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors"


            queryString <- list([ 'id' ] = "1")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors?id=1" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors?id=1")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/doors/search:
    post:
      tags:
        - Doors
      summary: View All Doors v2
      operationId: searchDoorSearch
      description: >-
        This API is used to view door records from BioStar X.


        It is required to at least put {} on the body for the API to run
        correctly.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: >-
                    Limit the number of records on the response according to the
                    value specified
                  example: 25
                search_text:
                  type: string
                  description: Find records with the specified string
                  example: ''
                door_group_id:
                  type: integer
                  description: >-
                    Limit the records to only those with `door_group_id
                    specified`
                  example: 1
                order_by:
                  type: string
                  description: >-
                    Sort the response by stated value (`id`,
                    `door_group_id.name`). Toggle boolean to switch ascending or
                    descending.
                  example: door_group_id.name:true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/doors/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"limit":25,"search_text":"","door_group_id":1,"order_by":"door_group_id.name:true"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"limit":25,"search_text":"","door_group_id":1,"order_by":"door_group_id.name:true"}'
            |  \
              http POST https://{baseurl}/api/v2/doors/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"limit":25,"search_text":"","door_group_id":1,"order_by":"door_group_id.name:true"}' \
              --output-document \
              - https://{baseurl}/api/v2/doors/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/doors/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              limit: 25,
              search_text: '',
              door_group_id: 1,
              order_by: 'door_group_id.name:true'
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/doors/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                limit: 25,
                search_text: '',
                door_group_id: 1,
                order_by: 'door_group_id.name:true'
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/doors/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "limit": 25,
              "search_text": "",
              "door_group_id": 1,
              "order_by": "door_group_id.name:true"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/doors/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                limit: 25,
                search_text: '',
                door_group_id: 1,
                order_by: 'door_group_id.name:true'
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/doors/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":25,"search_text":"","door_group_id":1,"order_by":"door_group_id.name:true"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":25,"search_text":"","door_group_id":1,"order_by":"door_group_id.name:true"}'
            };

            fetch('https://{baseurl}/api/v2/doors/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/doors/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "limit": 25,
              "search_text": "",
              "door_group_id": 1,
              "order_by": "door_group_id.name:true"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/doors/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/doors/search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/doors/search"


            payload = {
                "limit": 25,
                "search_text": "",
                "door_group_id": 1,
                "order_by": "door_group_id.name:true"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/doors/search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/doors/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/doors/search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"limit":25,"search_text":"","door_group_id":1,"order_by":"door_group_id.name:true"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"limit":25,"search_text":"","door_group_id":1,"order_by":"door_group_id.name:true"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/doors/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/doors/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/doors/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/doors/search\"\n\n\tpayload := strings.NewReader(\"{\\\"limit\\\":25,\\\"search_text\\\":\\\"\\\",\\\"door_group_id\\\":1,\\\"order_by\\\":\\\"door_group_id.name:true\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/doors/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"limit": @25,
                                          @"search_text": @"",
                                          @"door_group_id": @1,
                                          @"order_by": @"door_group_id.name:true" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/doors/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "limit": 25,
              "search_text": "",
              "door_group_id": 1,
              "order_by": "door_group_id.name:true"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/doors/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/doors/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/doors/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/doors/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"limit":25,"search_text":"","door_group_id":1,"order_by":"door_group_id.name:true"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/doors/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"limit":25,"search_text":"","door_group_id":1,"order_by":"door_group_id.name:true"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/doors/search"


            payload <-
            "{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/doors/search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"limit\":25,\"search_text\":\"\",\"door_group_id\":1,\"order_by\":\"door_group_id.name:true\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/doors/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/doors/status:
    post:
      tags:
        - Doors
      summary: View Door Status
      operationId: createDoorStatus
      description: >-
        This API is used to view various door status information such as the
        door status, relay status, alarm and last event.


        * Fire alarm unlocked: A state where the door designated as a fire alarm
        zone is unlocked because a fire has broken out.

        * Manual Lock: A state where the door is locked because the
        administrator has locked it manually.

        * Manual Unlock: A state where the door is unlocked and able to enter
        without an authentication because the administrator has unlocked it
        manually.

        * Schedule Locked: A state where the door is locked by the schedule that
        has been set.

        * Schedule Unlocked: A state where the door is unlocked by the schedule
        that has been set.

        * Normal: A state where a user can enter the door after an
        authentication.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                monitoring_permission: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/doors/status \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"monitoring_permission":true}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"monitoring_permission":true}' |  \
              http POST https://{baseurl}/api/doors/status \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"monitoring_permission":true}' \
              --output-document \
              - https://{baseurl}/api/doors/status
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors/status",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({monitoring_permission: true}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/status',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {monitoring_permission: true},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/doors/status");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "monitoring_permission": true
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/status',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {monitoring_permission: true}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/doors/status';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"monitoring_permission":true}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"monitoring_permission":true}'
            };

            fetch('https://{baseurl}/api/doors/status', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors/status",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"monitoring_permission\":true}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "monitoring_permission": true
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/doors/status");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            payload = "{\"monitoring_permission\":true}"

            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/doors/status", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors/status"


            payload = {"monitoring_permission": True}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/doors/status")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"monitoring_permission\":true}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors/status",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"monitoring_permission\":true}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/doors/status');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"monitoring_permission":true}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"monitoring_permission":true}');

            $request->setRequestUrl('https://{baseurl}/api/doors/status');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"monitoring_permission\":true}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors/status")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/doors/status")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"monitoring_permission\":true}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors/status\"\n\n\tpayload := strings.NewReader(\"{\\\"monitoring_permission\\\":true}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors/status");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"monitoring_permission\":true}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"monitoring_permission": @YES };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors/status"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["monitoring_permission": true] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors/status")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/doors/status");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"monitoring_permission\":true}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/doors/status"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"monitoring_permission\":true}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors/status' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"monitoring_permission":true}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors/status' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"monitoring_permission":true}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors/status"


            payload <- "{\"monitoring_permission\":true}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors/status" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"monitoring_permission\":true}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"monitoring_permission\":true}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors/status")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/doors/clear_alarm:
    post:
      tags:
        - Doors
      summary: Clear Door Alarm
      operationId: createDoorClearAlarm
      description: >-
        This API is used to clear alarms of all doors. If an alarm is  

        set in the Zone, the alarm may be continuously output even if the door
        alarm is released.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DoorCollection:
                  $ref: '#/components/schemas/DoorCollection'
              example:
                DoorCollection:
                  rows:
                    - id: 35
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/doors/clear_alarm \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DoorCollection":{"rows":[{"id":35}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"DoorCollection":{"rows":[{"id":35}]}}' |  \
              http POST https://{baseurl}/api/doors/clear_alarm \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DoorCollection":{"rows":[{"id":35}]}}' \
              --output-document \
              - https://{baseurl}/api/doors/clear_alarm
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors/clear_alarm",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({DoorCollection: {rows: [{id: 35}]}}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/clear_alarm',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DoorCollection: {rows: [{id: 35}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/doors/clear_alarm");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "DoorCollection": {
                "rows": [
                  {
                    "id": 35
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/clear_alarm',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DoorCollection: {rows: [{id: 35}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/doors/clear_alarm';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorCollection":{"rows":[{"id":35}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorCollection":{"rows":[{"id":35}]}}'
            };

            fetch('https://{baseurl}/api/doors/clear_alarm', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors/clear_alarm",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DoorCollection": {
                "rows": [
                  {
                    "id": 35
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/doors/clear_alarm");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/doors/clear_alarm", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors/clear_alarm"


            payload = {"DoorCollection": {"rows": [{"id": 35}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/doors/clear_alarm")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors/clear_alarm",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/doors/clear_alarm');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"DoorCollection":{"rows":[{"id":35}]}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"DoorCollection":{"rows":[{"id":35}]}}');

            $request->setRequestUrl('https://{baseurl}/api/doors/clear_alarm');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors/clear_alarm")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/doors/clear_alarm")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors/clear_alarm\"\n\n\tpayload := strings.NewReader(\"{\\\"DoorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":35}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors/clear_alarm");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DoorCollection": @{ @"rows": @[ @{
            @"id": @35 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors/clear_alarm"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DoorCollection": ["rows": [["id": 35]]]] as
            [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors/clear_alarm")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/doors/clear_alarm");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/doors/clear_alarm"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors/clear_alarm' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DoorCollection":{"rows":[{"id":35}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors/clear_alarm' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"DoorCollection":{"rows":[{"id":35}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors/clear_alarm"


            payload <- "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors/clear_alarm" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors/clear_alarm")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/doors/clear_apb_ex:
    post:
      tags:
        - Doors
      summary: 'Clear Anti PassBack: Specific User(s)'
      operationId: createDoorClearApbEx
      description: This example shows how to clear APB for specific user(s).
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                AntiPassBackConfig:
                  $ref: '#/components/schemas/TimedAntiPassBackConfig'
              example:
                AntiPassBackConfig:
                  Door:
                    DoorCollection:
                      rows:
                        - id: 35
                  User:
                    - user_id: '10'
                    - user_id: '12'
                  UserType: 2
                target: users:,[object Object],[object Object]
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/doors/clear_apb_ex \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"AntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":35}]}},"User":[{"user_id":"10"},{"user_id":"12"}],"UserType":2},"target":"users:,[object Object],[object Object]"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"AntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":35}]}},"User":[{"user_id":"10"},{"user_id":"12"}],"UserType":2},"target":"users:,[object
            Object],[object Object]"}' |  \
              http POST https://{baseurl}/api/doors/clear_apb_ex \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"AntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":35}]}},"User":[{"user_id":"10"},{"user_id":"12"}],"UserType":2},"target":"users:,[object Object],[object Object]"}' \
              --output-document \
              - https://{baseurl}/api/doors/clear_apb_ex
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors/clear_apb_ex",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              AntiPassBackConfig: {
                Door: {DoorCollection: {rows: [{id: 35}]}},
                User: [{user_id: '10'}, {user_id: '12'}],
                UserType: 2
              },
              target: 'users:,[object Object],[object Object]'
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/clear_apb_ex',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                AntiPassBackConfig: {
                  Door: {DoorCollection: {rows: [{id: 35}]}},
                  User: [{user_id: '10'}, {user_id: '12'}],
                  UserType: 2
                },
                target: 'users:,[object Object],[object Object]'
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/doors/clear_apb_ex");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "AntiPassBackConfig": {
                "Door": {
                  "DoorCollection": {
                    "rows": [
                      {
                        "id": 35
                      }
                    ]
                  }
                },
                "User": [
                  {
                    "user_id": "10"
                  },
                  {
                    "user_id": "12"
                  }
                ],
                "UserType": 2
              },
              "target": "users:,[object Object],[object Object]"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/clear_apb_ex',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                AntiPassBackConfig: {
                  Door: {DoorCollection: {rows: [{id: 35}]}},
                  User: [{user_id: '10'}, {user_id: '12'}],
                  UserType: 2
                },
                target: 'users:,[object Object],[object Object]'
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/doors/clear_apb_ex';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":35}]}},"User":[{"user_id":"10"},{"user_id":"12"}],"UserType":2},"target":"users:,[object Object],[object Object]"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":35}]}},"User":[{"user_id":"10"},{"user_id":"12"}],"UserType":2},"target":"users:,[object Object],[object Object]"}'
            };

            fetch('https://{baseurl}/api/doors/clear_apb_ex', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors/clear_apb_ex",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object Object],[object Object]\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "AntiPassBackConfig": {
                "Door": {
                  "DoorCollection": {
                    "rows": [
                      {
                        "id": 35
                      }
                    ]
                  }
                },
                "User": [
                  {
                    "user_id": "10"
                  },
                  {
                    "user_id": "12"
                  }
                ],
                "UserType": 2
              },
              "target": "users:,[object Object],[object Object]"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/doors/clear_apb_ex");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object
            Object],[object Object]\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/doors/clear_apb_ex", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors/clear_apb_ex"


            payload = {
                "AntiPassBackConfig": {
                    "Door": {"DoorCollection": {"rows": [{"id": 35}]}},
                    "User": [{"user_id": "10"}, {"user_id": "12"}],
                    "UserType": 2
                },
                "target": "users:,[object Object],[object Object]"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/doors/clear_apb_ex")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object
            Object],[object Object]\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors/clear_apb_ex",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object Object],[object Object]\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/doors/clear_apb_ex');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"AntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":35}]}},"User":[{"user_id":"10"},{"user_id":"12"}],"UserType":2},"target":"users:,[object
            Object],[object Object]"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"AntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":35}]}},"User":[{"user_id":"10"},{"user_id":"12"}],"UserType":2},"target":"users:,[object
            Object],[object Object]"}');


            $request->setRequestUrl('https://{baseurl}/api/doors/clear_apb_ex');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object
            Object],[object Object]\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors/clear_apb_ex")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/doors/clear_apb_ex")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object Object],[object Object]\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors/clear_apb_ex\"\n\n\tpayload := strings.NewReader(\"{\\\"AntiPassBackConfig\\\":{\\\"Door\\\":{\\\"DoorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":35}]}},\\\"User\\\":[{\\\"user_id\\\":\\\"10\\\"},{\\\"user_id\\\":\\\"12\\\"}],\\\"UserType\\\":2},\\\"target\\\":\\\"users:,[object Object],[object Object]\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors/clear_apb_ex");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object
            Object],[object Object]\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"AntiPassBackConfig": @{ @"Door": @{
            @"DoorCollection": @{ @"rows": @[ @{ @"id": @35 } ] } }, @"User": @[
            @{ @"user_id": @"10" }, @{ @"user_id": @"12" } ], @"UserType": @2 },
                                          @"target": @"users:,[object Object],[object Object]" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors/clear_apb_ex"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "AntiPassBackConfig": [
                "Door": ["DoorCollection": ["rows": [["id": 35]]]],
                "User": [["user_id": "10"], ["user_id": "12"]],
                "UserType": 2
              ],
              "target": "users:,[object Object],[object Object]"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors/clear_apb_ex")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/doors/clear_apb_ex");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object
            Object],[object Object]\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/doors/clear_apb_ex"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object Object],[object Object]\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors/clear_apb_ex' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"AntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":35}]}},"User":[{"user_id":"10"},{"user_id":"12"}],"UserType":2},"target":"users:,[object
            Object],[object Object]"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors/clear_apb_ex' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"AntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":35}]}},"User":[{"user_id":"10"},{"user_id":"12"}],"UserType":2},"target":"users:,[object
            Object],[object Object]"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors/clear_apb_ex"


            payload <-
            "{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object
            Object],[object Object]\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors/clear_apb_ex"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object
            Object],[object Object]\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"AntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":35}]}},\"User\":[{\"user_id\":\"10\"},{\"user_id\":\"12\"}],\"UserType\":2},\"target\":\"users:,[object
            Object],[object Object]\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors/clear_apb_ex")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/doors/lock:
    post:
      tags:
        - Doors
      summary: Manual Lock Door
      operationId: createDoorLock
      description: >-
        This API is used to lock a door manually. If you set the state to Manual
        Lock, the door will have remained inaccessible even if a user
        authentication succeeded.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DoorCollection:
                  $ref: '#/components/schemas/DoorCollection'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/doors/lock \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DoorCollection":{"rows":[{"id":0}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"DoorCollection":{"rows":[{"id":0}]}}' |  \
              http POST https://{baseurl}/api/doors/lock \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DoorCollection":{"rows":[{"id":0}]}}' \
              --output-document \
              - https://{baseurl}/api/doors/lock
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors/lock",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({DoorCollection: {rows: [{id: 0}]}}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/lock',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DoorCollection: {rows: [{id: 0}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/doors/lock");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DoorCollection": {
                "rows": [
                  {
                    "id": 0
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/lock',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DoorCollection: {rows: [{id: 0}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/doors/lock';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorCollection":{"rows":[{"id":0}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorCollection":{"rows":[{"id":0}]}}'
            };

            fetch('https://{baseurl}/api/doors/lock', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors/lock",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DoorCollection": {
                "rows": [
                  {
                    "id": 0
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/doors/lock");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            payload = "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"

            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/doors/lock", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors/lock"


            payload = {"DoorCollection": {"rows": [{"id": 0}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/doors/lock")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors/lock",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/doors/lock');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"DoorCollection":{"rows":[{"id":0}]}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"DoorCollection":{"rows":[{"id":0}]}}');

            $request->setRequestUrl('https://{baseurl}/api/doors/lock');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors/lock")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/doors/lock")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors/lock\"\n\n\tpayload := strings.NewReader(\"{\\\"DoorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":0}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors/lock");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DoorCollection": @{ @"rows": @[ @{
            @"id": @0 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors/lock"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DoorCollection": ["rows": [["id": 0]]]] as
            [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors/lock")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/doors/lock");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/doors/lock"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors/lock' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorCollection":{"rows":[{"id":0}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors/lock' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorCollection":{"rows":[{"id":0}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors/lock"


            payload <- "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors/lock" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors/lock")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/doors/unlock:
    post:
      tags:
        - Doors
      summary: Manual Unlock Door
      operationId: createDoorUnlock
      description: >-
        This API is used to unlock a door manually. If you set the state to
        Manual Unlock, the door will have remained accessible even if a user
        does not authenticate.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DoorCollection:
                  $ref: '#/components/schemas/DoorCollection'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/doors/unlock \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DoorCollection":{"rows":[{"id":0}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"DoorCollection":{"rows":[{"id":0}]}}' |  \
              http POST https://{baseurl}/api/doors/unlock \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DoorCollection":{"rows":[{"id":0}]}}' \
              --output-document \
              - https://{baseurl}/api/doors/unlock
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors/unlock",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({DoorCollection: {rows: [{id: 0}]}}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/unlock',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DoorCollection: {rows: [{id: 0}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/doors/unlock");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DoorCollection": {
                "rows": [
                  {
                    "id": 0
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/unlock',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DoorCollection: {rows: [{id: 0}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/doors/unlock';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorCollection":{"rows":[{"id":0}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorCollection":{"rows":[{"id":0}]}}'
            };

            fetch('https://{baseurl}/api/doors/unlock', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors/unlock",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DoorCollection": {
                "rows": [
                  {
                    "id": 0
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/doors/unlock");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            payload = "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"

            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/doors/unlock", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors/unlock"


            payload = {"DoorCollection": {"rows": [{"id": 0}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/doors/unlock")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors/unlock",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/doors/unlock');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"DoorCollection":{"rows":[{"id":0}]}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"DoorCollection":{"rows":[{"id":0}]}}');

            $request->setRequestUrl('https://{baseurl}/api/doors/unlock');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors/unlock")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/doors/unlock")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors/unlock\"\n\n\tpayload := strings.NewReader(\"{\\\"DoorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":0}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors/unlock");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DoorCollection": @{ @"rows": @[ @{
            @"id": @0 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors/unlock"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DoorCollection": ["rows": [["id": 0]]]] as
            [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors/unlock")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/doors/unlock");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/doors/unlock"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors/unlock' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorCollection":{"rows":[{"id":0}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors/unlock' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorCollection":{"rows":[{"id":0}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors/unlock"


            payload <- "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors/unlock" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors/unlock")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/doors/release:
    post:
      tags:
        - Doors
      summary: Release Manual Lock/Unlock
      operationId: createDoorRelease
      description: >-
        This API is used to release the manual lock or manual unlock set by the
        administrator.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DoorCollection:
                  $ref: '#/components/schemas/DoorCollection'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/doors/release \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DoorCollection":{"rows":[{"id":0}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"DoorCollection":{"rows":[{"id":0}]}}' |  \
              http POST https://{baseurl}/api/doors/release \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DoorCollection":{"rows":[{"id":0}]}}' \
              --output-document \
              - https://{baseurl}/api/doors/release
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors/release",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({DoorCollection: {rows: [{id: 0}]}}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/release',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DoorCollection: {rows: [{id: 0}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/doors/release");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DoorCollection": {
                "rows": [
                  {
                    "id": 0
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/release',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DoorCollection: {rows: [{id: 0}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/doors/release';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorCollection":{"rows":[{"id":0}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorCollection":{"rows":[{"id":0}]}}'
            };

            fetch('https://{baseurl}/api/doors/release', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors/release",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DoorCollection": {
                "rows": [
                  {
                    "id": 0
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/doors/release");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/doors/release", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors/release"


            payload = {"DoorCollection": {"rows": [{"id": 0}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/doors/release")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors/release",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/doors/release');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"DoorCollection":{"rows":[{"id":0}]}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"DoorCollection":{"rows":[{"id":0}]}}');

            $request->setRequestUrl('https://{baseurl}/api/doors/release');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors/release")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/doors/release")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors/release\"\n\n\tpayload := strings.NewReader(\"{\\\"DoorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":0}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors/release");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DoorCollection": @{ @"rows": @[ @{
            @"id": @0 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors/release"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DoorCollection": ["rows": [["id": 0]]]] as
            [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors/release")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/doors/release");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/doors/release"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors/release' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorCollection":{"rows":[{"id":0}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors/release' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorCollection":{"rows":[{"id":0}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors/release"


            payload <- "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors/release" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DoorCollection\":{\"rows\":[{\"id\":0}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors/release")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/doors/clear_timed_apb_ex:
    post:
      tags:
        - Doors
      summary: Clear Timed APB
      operationId: createDoorClearTimedApbEx
      description: This API is used to clear Timed APB access record.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                TimedAntiPassBackConfig:
                  $ref: '#/components/schemas/TimedAntiPassBackConfig'
              example:
                TimedAntiPassBackConfig:
                  Door:
                    DoorCollection:
                      rows:
                        - id: 30
                  User:
                    - user_id: '1'
                  UserType: 2
                target: users:,[object Object]
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  DeviceResponse:
                    $ref: '#/components/schemas/DeviceResponse'
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
                example:
                  DeviceResponse:
                    rows:
                      - id: '50335900'
                        code: '0'
                    result: 'true'
                  Response:
                    code: '0'
                    link: https://support.supremainc.com/en/support/home
                    message: Success
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.'
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/doors/clear_timed_apb_ex \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"TimedAntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":30}]}},"User":[{"user_id":"1"}],"UserType":2},"target":"users:,[object Object]"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"TimedAntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":30}]}},"User":[{"user_id":"1"}],"UserType":2},"target":"users:,[object
            Object]"}' |  \
              http POST https://{baseurl}/api/doors/clear_timed_apb_ex \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"TimedAntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":30}]}},"User":[{"user_id":"1"}],"UserType":2},"target":"users:,[object Object]"}' \
              --output-document \
              - https://{baseurl}/api/doors/clear_timed_apb_ex
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors/clear_timed_apb_ex",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              TimedAntiPassBackConfig: {
                Door: {DoorCollection: {rows: [{id: 30}]}},
                User: [{user_id: '1'}],
                UserType: 2
              },
              target: 'users:,[object Object]'
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/clear_timed_apb_ex',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                TimedAntiPassBackConfig: {
                  Door: {DoorCollection: {rows: [{id: 30}]}},
                  User: [{user_id: '1'}],
                  UserType: 2
                },
                target: 'users:,[object Object]'
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/doors/clear_timed_apb_ex");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "TimedAntiPassBackConfig": {
                "Door": {
                  "DoorCollection": {
                    "rows": [
                      {
                        "id": 30
                      }
                    ]
                  }
                },
                "User": [
                  {
                    "user_id": "1"
                  }
                ],
                "UserType": 2
              },
              "target": "users:,[object Object]"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/clear_timed_apb_ex',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                TimedAntiPassBackConfig: {
                  Door: {DoorCollection: {rows: [{id: 30}]}},
                  User: [{user_id: '1'}],
                  UserType: 2
                },
                target: 'users:,[object Object]'
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/doors/clear_timed_apb_ex';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"TimedAntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":30}]}},"User":[{"user_id":"1"}],"UserType":2},"target":"users:,[object Object]"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"TimedAntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":30}]}},"User":[{"user_id":"1"}],"UserType":2},"target":"users:,[object Object]"}'
            };

            fetch('https://{baseurl}/api/doors/clear_timed_apb_ex', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors/clear_timed_apb_ex",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object Object]\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "TimedAntiPassBackConfig": {
                "Door": {
                  "DoorCollection": {
                    "rows": [
                      {
                        "id": 30
                      }
                    ]
                  }
                },
                "User": [
                  {
                    "user_id": "1"
                  }
                ],
                "UserType": 2
              },
              "target": "users:,[object Object]"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/doors/clear_timed_apb_ex");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object
            Object]\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/doors/clear_timed_apb_ex",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors/clear_timed_apb_ex"


            payload = {
                "TimedAntiPassBackConfig": {
                    "Door": {"DoorCollection": {"rows": [{"id": 30}]}},
                    "User": [{"user_id": "1"}],
                    "UserType": 2
                },
                "target": "users:,[object Object]"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/doors/clear_timed_apb_ex")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object
            Object]\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors/clear_timed_apb_ex",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object Object]\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/doors/clear_timed_apb_ex');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"TimedAntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":30}]}},"User":[{"user_id":"1"}],"UserType":2},"target":"users:,[object
            Object]"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"TimedAntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":30}]}},"User":[{"user_id":"1"}],"UserType":2},"target":"users:,[object
            Object]"}');


            $request->setRequestUrl('https://{baseurl}/api/doors/clear_timed_apb_ex');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object
            Object]\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors/clear_timed_apb_ex")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/doors/clear_timed_apb_ex")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object Object]\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors/clear_timed_apb_ex\"\n\n\tpayload := strings.NewReader(\"{\\\"TimedAntiPassBackConfig\\\":{\\\"Door\\\":{\\\"DoorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":30}]}},\\\"User\\\":[{\\\"user_id\\\":\\\"1\\\"}],\\\"UserType\\\":2},\\\"target\\\":\\\"users:,[object Object]\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors/clear_timed_apb_ex");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object
            Object]\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"TimedAntiPassBackConfig": @{
            @"Door": @{ @"DoorCollection": @{ @"rows": @[ @{ @"id": @30 } ] } },
            @"User": @[ @{ @"user_id": @"1" } ], @"UserType": @2 },
                                          @"target": @"users:,[object Object]" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors/clear_timed_apb_ex"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "TimedAntiPassBackConfig": [
                "Door": ["DoorCollection": ["rows": [["id": 30]]]],
                "User": [["user_id": "1"]],
                "UserType": 2
              ],
              "target": "users:,[object Object]"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors/clear_timed_apb_ex")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/doors/clear_timed_apb_ex");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object
            Object]\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/doors/clear_timed_apb_ex"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object Object]\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors/clear_timed_apb_ex' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"TimedAntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":30}]}},"User":[{"user_id":"1"}],"UserType":2},"target":"users:,[object
            Object]"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors/clear_timed_apb_ex' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"TimedAntiPassBackConfig":{"Door":{"DoorCollection":{"rows":[{"id":30}]}},"User":[{"user_id":"1"}],"UserType":2},"target":"users:,[object
            Object]"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors/clear_timed_apb_ex"


            payload <-
            "{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object
            Object]\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/doors/clear_timed_apb_ex" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object
            Object]\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"TimedAntiPassBackConfig\":{\"Door\":{\"DoorCollection\":{\"rows\":[{\"id\":30}]}},\"User\":[{\"user_id\":\"1\"}],\"UserType\":2},\"target\":\"users:,[object
            Object]\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors/clear_timed_apb_ex")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/doors/open:
    post:
      tags:
        - Doors
      summary: Open Door
      operationId: createDoorOpen
      description: This API is used to open a door.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                DoorCollection:
                  $ref: '#/components/schemas/DoorCollection'
              example:
                DoorCollection:
                  rows:
                    - id: 35
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/doors/open \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"DoorCollection":{"rows":[{"id":35}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"DoorCollection":{"rows":[{"id":35}]}}' |  \
              http POST https://{baseurl}/api/doors/open \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"DoorCollection":{"rows":[{"id":35}]}}' \
              --output-document \
              - https://{baseurl}/api/doors/open
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors/open",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({DoorCollection: {rows: [{id: 35}]}}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/open',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {DoorCollection: {rows: [{id: 35}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/doors/open");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "DoorCollection": {
                "rows": [
                  {
                    "id": 35
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/doors/open',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {DoorCollection: {rows: [{id: 35}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/doors/open';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorCollection":{"rows":[{"id":35}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"DoorCollection":{"rows":[{"id":35}]}}'
            };

            fetch('https://{baseurl}/api/doors/open', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors/open",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "DoorCollection": {
                "rows": [
                  {
                    "id": 35
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/doors/open");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            payload = "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}"

            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/doors/open", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/doors/open"


            payload = {"DoorCollection": {"rows": [{"id": 35}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/doors/open")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors/open",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/doors/open');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"DoorCollection":{"rows":[{"id":35}]}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"DoorCollection":{"rows":[{"id":35}]}}');

            $request->setRequestUrl('https://{baseurl}/api/doors/open');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors/open")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/doors/open")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors/open\"\n\n\tpayload := strings.NewReader(\"{\\\"DoorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":35}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors/open");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"DoorCollection": @{ @"rows": @[ @{
            @"id": @35 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors/open"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["DoorCollection": ["rows": [["id": 35]]]] as
            [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors/open")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/doors/open");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/doors/open"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors/open' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorCollection":{"rows":[{"id":35}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors/open' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"DoorCollection":{"rows":[{"id":35}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors/open"


            payload <- "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors/open" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"DoorCollection\":{\"rows\":[{\"id\":35}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors/open")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/doors/rs485/{id}:
    get:
      tags:
        - Doors
      summary: View Doors with RS485
      operationId: getDoorRs485
      description: >-
        This API is used to list doors which use devices that connected to the
        system using RS485.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the door which will be viewed
          example: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/doors/rs485/1 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/doors/rs485/1 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/doors/rs485/1
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/doors/rs485/1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/doors/rs485/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/doors/rs485/1");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/doors/rs485/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/doors/rs485/1';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/doors/rs485/1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/doors/rs485/1",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/doors/rs485/1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/doors/rs485/1", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/doors/rs485/1"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/doors/rs485/1")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/doors/rs485/1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/doors/rs485/1');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/doors/rs485/1');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/doors/rs485/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/doors/rs485/1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/doors/rs485/1\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/doors/rs485/1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/doors/rs485/1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/doors/rs485/1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/doors/rs485/1");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/doors/rs485/1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/doors/rs485/1' -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/doors/rs485/1' -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/doors/rs485/1"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/doors/rs485/1" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/doors/rs485/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/door_tree/search:
    post:
      tags:
        - Doors
      summary: Retrieve Door Tree
      operationId: searchDoorTreesearch
      description: >-
        Retrieves the hierarchical structure of door groups and doors, including
        device and status information.


        This endpoint is commonly used to populate door monitoring trees, access
        control dashboards, or group-based door management UIs.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                root_id:
                  type: integer
                  description: The ID of the root door group to start searching from.
                  example: 1
                max_recursion_depth:
                  type: integer
                  description: Maximum depth of recursive traversal through child groups.
                  example: 7
                collapsed_node_ids:
                  type: array
                  description: >-
                    Fill with child group IDs to set `is_collapsed` parameter on
                    response to `true`.
                  items:
                    type: integer
                  example:
                    - 2
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/door_tree/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"root_id":1,"max_recursion_depth":7,"collapsed_node_ids":[2]}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"root_id":1,"max_recursion_depth":7,"collapsed_node_ids":[2]}' | 
            \
              http POST https://{baseurl}/api/v2/door_tree/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"root_id":1,"max_recursion_depth":7,"collapsed_node_ids":[2]}' \
              --output-document \
              - https://{baseurl}/api/v2/door_tree/search
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/door_tree/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({root_id: 1, max_recursion_depth: 7,
            collapsed_node_ids: [2]}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/door_tree/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {root_id: 1, max_recursion_depth: 7, collapsed_node_ids: [2]},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/door_tree/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "root_id": 1,
              "max_recursion_depth": 7,
              "collapsed_node_ids": [
                2
              ]
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/door_tree/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {root_id: 1, max_recursion_depth: 7, collapsed_node_ids: [2]}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/door_tree/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"root_id":1,"max_recursion_depth":7,"collapsed_node_ids":[2]}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"root_id":1,"max_recursion_depth":7,"collapsed_node_ids":[2]}'
            };

            fetch('https://{baseurl}/api/v2/door_tree/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/door_tree/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "root_id": 1,
              "max_recursion_depth": 7,
              "collapsed_node_ids": [
                2
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/door_tree/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/door_tree/search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/door_tree/search"


            payload = {
                "root_id": 1,
                "max_recursion_depth": 7,
                "collapsed_node_ids": [2]
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/door_tree/search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/door_tree/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/door_tree/search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"root_id":1,"max_recursion_depth":7,"collapsed_node_ids":[2]}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"root_id":1,"max_recursion_depth":7,"collapsed_node_ids":[2]}');


            $request->setRequestUrl('https://{baseurl}/api/v2/door_tree/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/door_tree/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/door_tree/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/door_tree/search\"\n\n\tpayload := strings.NewReader(\"{\\\"root_id\\\":1,\\\"max_recursion_depth\\\":7,\\\"collapsed_node_ids\\\":[2]}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/door_tree/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"root_id": @1,
                                          @"max_recursion_depth": @7,
                                          @"collapsed_node_ids": @[ @2 ] };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/door_tree/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "root_id": 1,
              "max_recursion_depth": 7,
              "collapsed_node_ids": [2]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/door_tree/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/door_tree/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/door_tree/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/door_tree/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"root_id":1,"max_recursion_depth":7,"collapsed_node_ids":[2]}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/door_tree/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"root_id":1,"max_recursion_depth":7,"collapsed_node_ids":[2]}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/door_tree/search"


            payload <-
            "{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/door_tree/search"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"root_id\":1,\"max_recursion_depth\":7,\"collapsed_node_ids\":[2]}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/door_tree/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/elevator_groups:
    post:
      tags:
        - Elevator Groups
      summary: Create Elevator Group
      operationId: createElevatorGroup
      description: This API is used to create elevator group.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ElevatorGroup'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/elevator_groups \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New Elevator Group 2","name":"New Elevator Group 2"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New
            Elevator Group 2","name":"New Elevator Group 2"}}' |  \
              http POST https://{baseurl}/api/elevator_groups \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New Elevator Group 2","name":"New Elevator Group 2"}}' \
              --output-document \
              - https://{baseurl}/api/elevator_groups
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevator_groups",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              ElevatorGroup: {
                parent_id: {id: 1},
                isElevatorGroups: true,
                depth: 1,
                sync_device_groups: [],
                sync_devices: [],
                inherited: true,
                iconCls: 'elevatorGroupIcon',
                text: 'New Elevator Group 2',
                name: 'New Elevator Group 2'
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevator_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                ElevatorGroup: {
                  parent_id: {id: 1},
                  isElevatorGroups: true,
                  depth: 1,
                  sync_device_groups: [],
                  sync_devices: [],
                  inherited: true,
                  iconCls: 'elevatorGroupIcon',
                  text: 'New Elevator Group 2',
                  name: 'New Elevator Group 2'
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/elevator_groups");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "ElevatorGroup": {
                "parent_id": {
                  "id": 1
                },
                "isElevatorGroups": true,
                "depth": 1,
                "sync_device_groups": [],
                "sync_devices": [],
                "inherited": true,
                "iconCls": "elevatorGroupIcon",
                "text": "New Elevator Group 2",
                "name": "New Elevator Group 2"
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevator_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                ElevatorGroup: {
                  parent_id: {id: 1},
                  isElevatorGroups: true,
                  depth: 1,
                  sync_device_groups: [],
                  sync_devices: [],
                  inherited: true,
                  iconCls: 'elevatorGroupIcon',
                  text: 'New Elevator Group 2',
                  name: 'New Elevator Group 2'
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/elevator_groups';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New Elevator Group 2","name":"New Elevator Group 2"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New Elevator Group 2","name":"New Elevator Group 2"}}'
            };

            fetch('https://{baseurl}/api/elevator_groups', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevator_groups",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "ElevatorGroup": {
                "parent_id": {
                  "id": 1
                },
                "isElevatorGroups": true,
                "depth": 1,
                "sync_device_groups": [],
                "sync_devices": [],
                "inherited": true,
                "iconCls": "elevatorGroupIcon",
                "text": "New Elevator Group 2",
                "name": "New Elevator Group 2"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/elevator_groups");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/elevator_groups", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/elevator_groups"


            payload = {"ElevatorGroup": {
                    "parent_id": {"id": 1},
                    "isElevatorGroups": True,
                    "depth": 1,
                    "sync_device_groups": [],
                    "sync_devices": [],
                    "inherited": True,
                    "iconCls": "elevatorGroupIcon",
                    "text": "New Elevator Group 2",
                    "name": "New Elevator Group 2"
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/elevator_groups")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevator_groups",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/elevator_groups');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New
            Elevator Group 2","name":"New Elevator Group 2"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New
            Elevator Group 2","name":"New Elevator Group 2"}}');


            $request->setRequestUrl('https://{baseurl}/api/elevator_groups');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevator_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/elevator_groups")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevator_groups\"\n\n\tpayload := strings.NewReader(\"{\\\"ElevatorGroup\\\":{\\\"parent_id\\\":{\\\"id\\\":1},\\\"isElevatorGroups\\\":true,\\\"depth\\\":1,\\\"sync_device_groups\\\":[],\\\"sync_devices\\\":[],\\\"inherited\\\":true,\\\"iconCls\\\":\\\"elevatorGroupIcon\\\",\\\"text\\\":\\\"New Elevator Group 2\\\",\\\"name\\\":\\\"New Elevator Group 2\\\"}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevator_groups");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ElevatorGroup": @{ @"parent_id": @{
            @"id": @1 }, @"isElevatorGroups": @YES, @"depth": @1,
            @"sync_device_groups": @[  ], @"sync_devices": @[  ], @"inherited":
            @YES, @"iconCls": @"elevatorGroupIcon", @"text": @"New Elevator
            Group 2", @"name": @"New Elevator Group 2" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevator_groups"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ElevatorGroup": [
                "parent_id": ["id": 1],
                "isElevatorGroups": true,
                "depth": 1,
                "sync_device_groups": [],
                "sync_devices": [],
                "inherited": true,
                "iconCls": "elevatorGroupIcon",
                "text": "New Elevator Group 2",
                "name": "New Elevator Group 2"
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevator_groups")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/elevator_groups");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/elevator_groups"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/elevator_groups' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New
            Elevator Group 2","name":"New Elevator Group 2"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/elevator_groups' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New
            Elevator Group 2","name":"New Elevator Group 2"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevator_groups"


            payload <-
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/elevator_groups" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevator_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/elevator_groups/search:
    post:
      tags:
        - Elevator Groups
      summary: List Elevator Group
      operationId: searchElevatorGroupsearch
      description: |-
        This API is used to list elevator groups recorded in BioStar X.

        It is required to at least put {} on body for the API to run correctly.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example: {}
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/elevator_groups/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{}' |  \
              http POST https://{baseurl}/api/v2/elevator_groups/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{}' \
              --output-document \
              - https://{baseurl}/api/v2/elevator_groups/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/elevator_groups/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/elevator_groups/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/elevator_groups/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({});


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/elevator_groups/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/elevator_groups/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{}'
            };

            fetch('https://{baseurl}/api/v2/elevator_groups/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/elevator_groups/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({});

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/elevator_groups/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/elevator_groups/search",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/elevator_groups/search"


            payload = {}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/elevator_groups/search")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/elevator_groups/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/elevator_groups/search');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{}');


            $request->setRequestUrl('https://{baseurl}/api/v2/elevator_groups/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            MediaType mediaType = MediaType.parse("application/json");
            RequestBody body = RequestBody.create(mediaType, "{}");
            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/elevator_groups/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/elevator_groups/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/elevator_groups/search\"\n\n\tpayload := strings.NewReader(\"{}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/elevator_groups/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{  };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/elevator_groups/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/elevator_groups/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/elevator_groups/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json", "{}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/elevator_groups/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/elevator_groups/search' -Method POST
            -Headers $headers -ContentType 'application/json' -Body '{}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/elevator_groups/search' -Method POST
            -Headers $headers -ContentType 'application/json' -Body '{}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/elevator_groups/search"


            payload <- "{}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/elevator_groups/search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string "{}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val mediaType = MediaType.parse("application/json")
            val body = RequestBody.create(mediaType, "{}")
            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/elevator_groups/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/elevator_groups/only_permission_item/search:
    post:
      tags:
        - Elevator Groups
      summary: List Elevator Group with Criteria & Permission
      operationId: searchElevatorGrouponlyPermissionItemsearch
      description: This API is used to view elevator groups with criteria and permissions.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                order_by:
                  type: string
                  description: >-
                    Sort the response records by value which inputted on this
                    parameter

                    Available fields: `id`, `name`, `depth`
              example:
                order_by: depth:false
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/elevator_groups/only_permission_item/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"order_by":"depth:false"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"order_by":"depth:false"}' |  \
              http POST https://{baseurl}/api/v2/elevator_groups/only_permission_item/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"order_by":"depth:false"}' \
              --output-document \
              - https://{baseurl}/api/v2/elevator_groups/only_permission_item/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/elevator_groups/only_permission_item/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({order_by: 'depth:false'}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/elevator_groups/only_permission_item/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {order_by: 'depth:false'},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/elevator_groups/only_permission_item/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "order_by": "depth:false"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/elevator_groups/only_permission_item/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {order_by: 'depth:false'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/elevator_groups/only_permission_item/search';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"order_by":"depth:false"}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"order_by":"depth:false"}'
            };


            fetch('https://{baseurl}/api/v2/elevator_groups/only_permission_item/search',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/elevator_groups/only_permission_item/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"order_by\":\"depth:false\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "order_by": "depth:false"
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/v2/elevator_groups/only_permission_item/search");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"order_by\":\"depth:false\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/v2/elevator_groups/only_permission_item/search",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url =
            "https://{baseurl}/api/v2/elevator_groups/only_permission_item/search"


            payload = {"order_by": "depth:false"}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/elevator_groups/only_permission_item/search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"order_by\":\"depth:false\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/elevator_groups/only_permission_item/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"order_by\":\"depth:false\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/elevator_groups/only_permission_item/search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"order_by":"depth:false"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"order_by":"depth:false"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/elevator_groups/only_permission_item/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"order_by\":\"depth:false\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/elevator_groups/only_permission_item/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/elevator_groups/only_permission_item/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"order_by\":\"depth:false\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/elevator_groups/only_permission_item/search\"\n\n\tpayload := strings.NewReader(\"{\\\"order_by\\\":\\\"depth:false\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/elevator_groups/only_permission_item/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"order_by\":\"depth:false\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"order_by": @"depth:false" };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/elevator_groups/only_permission_item/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["order_by": "depth:false"] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/elevator_groups/only_permission_item/search")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/elevator_groups/only_permission_item/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"order_by\":\"depth:false\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/elevator_groups/only_permission_item/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"order_by\":\"depth:false\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/elevator_groups/only_permission_item/search'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"order_by":"depth:false"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/elevator_groups/only_permission_item/search'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"order_by":"depth:false"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <-
            "https://{baseurl}/api/v2/elevator_groups/only_permission_item/search"


            payload <- "{\"order_by\":\"depth:false\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/elevator_groups/only_permission_item/search"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"order_by\":\"depth:false\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"order_by\":\"depth:false\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/elevator_groups/only_permission_item/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/elevator_groups/{id}:
    put:
      tags:
        - Elevator Groups
      summary: Update Elevator Group
      operationId: updateElevatorGroup
      description: |-
        This API is used to update elevator group.

        Up to 48 characters may be entered for an elevator group name.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ElevatorGroup'
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the elevator group which will be updated
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/elevator_groups/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New Elevator Group 2","name":"New Elevator Group 2"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New
            Elevator Group 2","name":"New Elevator Group 2"}}' |  \
              http PUT https://{baseurl}/api/elevator_groups/{id} \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New Elevator Group 2","name":"New Elevator Group 2"}}' \
              --output-document \
              - https://{baseurl}/api/elevator_groups/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevator_groups/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              ElevatorGroup: {
                parent_id: {id: 1},
                isElevatorGroups: true,
                depth: 1,
                sync_device_groups: [],
                sync_devices: [],
                inherited: true,
                iconCls: 'elevatorGroupIcon',
                text: 'New Elevator Group 2',
                name: 'New Elevator Group 2'
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/elevator_groups/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                ElevatorGroup: {
                  parent_id: {id: 1},
                  isElevatorGroups: true,
                  depth: 1,
                  sync_device_groups: [],
                  sync_devices: [],
                  inherited: true,
                  iconCls: 'elevatorGroupIcon',
                  text: 'New Elevator Group 2',
                  name: 'New Elevator Group 2'
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/elevator_groups/{id}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "ElevatorGroup": {
                "parent_id": {
                  "id": 1
                },
                "isElevatorGroups": true,
                "depth": 1,
                "sync_device_groups": [],
                "sync_devices": [],
                "inherited": true,
                "iconCls": "elevatorGroupIcon",
                "text": "New Elevator Group 2",
                "name": "New Elevator Group 2"
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/elevator_groups/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                ElevatorGroup: {
                  parent_id: {id: 1},
                  isElevatorGroups: true,
                  depth: 1,
                  sync_device_groups: [],
                  sync_devices: [],
                  inherited: true,
                  iconCls: 'elevatorGroupIcon',
                  text: 'New Elevator Group 2',
                  name: 'New Elevator Group 2'
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/elevator_groups/{id}';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New Elevator Group 2","name":"New Elevator Group 2"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New Elevator Group 2","name":"New Elevator Group 2"}}'
            };

            fetch('https://{baseurl}/api/elevator_groups/{id}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevator_groups/{id}",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "ElevatorGroup": {
                "parent_id": {
                  "id": 1
                },
                "isElevatorGroups": true,
                "depth": 1,
                "sync_device_groups": [],
                "sync_devices": [],
                "inherited": true,
                "iconCls": "elevatorGroupIcon",
                "text": "New Elevator Group 2",
                "name": "New Elevator Group 2"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/elevator_groups/{id}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/elevator_groups/{id}", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/elevator_groups/{id}"


            payload = {"ElevatorGroup": {
                    "parent_id": {"id": 1},
                    "isElevatorGroups": True,
                    "depth": 1,
                    "sync_device_groups": [],
                    "sync_devices": [],
                    "inherited": True,
                    "iconCls": "elevatorGroupIcon",
                    "text": "New Elevator Group 2",
                    "name": "New Elevator Group 2"
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/elevator_groups/{id}")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevator_groups/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/elevator_groups/{id}');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New
            Elevator Group 2","name":"New Elevator Group 2"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New
            Elevator Group 2","name":"New Elevator Group 2"}}');


            $request->setRequestUrl('https://{baseurl}/api/elevator_groups/{id}');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevator_groups/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/elevator_groups/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevator_groups/{id}\"\n\n\tpayload := strings.NewReader(\"{\\\"ElevatorGroup\\\":{\\\"parent_id\\\":{\\\"id\\\":1},\\\"isElevatorGroups\\\":true,\\\"depth\\\":1,\\\"sync_device_groups\\\":[],\\\"sync_devices\\\":[],\\\"inherited\\\":true,\\\"iconCls\\\":\\\"elevatorGroupIcon\\\",\\\"text\\\":\\\"New Elevator Group 2\\\",\\\"name\\\":\\\"New Elevator Group 2\\\"}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevator_groups/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ElevatorGroup": @{ @"parent_id": @{
            @"id": @1 }, @"isElevatorGroups": @YES, @"depth": @1,
            @"sync_device_groups": @[  ], @"sync_devices": @[  ], @"inherited":
            @YES, @"iconCls": @"elevatorGroupIcon", @"text": @"New Elevator
            Group 2", @"name": @"New Elevator Group 2" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevator_groups/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ElevatorGroup": [
                "parent_id": ["id": 1],
                "isElevatorGroups": true,
                "depth": 1,
                "sync_device_groups": [],
                "sync_devices": [],
                "inherited": true,
                "iconCls": "elevatorGroupIcon",
                "text": "New Elevator Group 2",
                "name": "New Elevator Group 2"
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevator_groups/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/elevator_groups/{id}");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/elevator_groups/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/elevator_groups/{id}' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New
            Elevator Group 2","name":"New Elevator Group 2"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/elevator_groups/{id}' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorGroup":{"parent_id":{"id":1},"isElevatorGroups":true,"depth":1,"sync_device_groups":[],"sync_devices":[],"inherited":true,"iconCls":"elevatorGroupIcon","text":"New
            Elevator Group 2","name":"New Elevator Group 2"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevator_groups/{id}"


            payload <-
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/elevator_groups/{id}"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}" in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"ElevatorGroup\":{\"parent_id\":{\"id\":1},\"isElevatorGroups\":true,\"depth\":1,\"sync_device_groups\":[],\"sync_devices\":[],\"inherited\":true,\"iconCls\":\"elevatorGroupIcon\",\"text\":\"New
            Elevator Group 2\",\"name\":\"New Elevator Group 2\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevator_groups/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/elevator_groups/{id}:
    delete:
      tags:
        - Elevator Groups
      summary: Delete Elevator Group
      operationId: deleteElevatorGroup
      description: |-
        This API is used to delete elevator group.

        Deleting a group deletes all elevators in the group.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the elevator group which will be deleted
          example: 5
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url https://{baseurl}/api/v2/elevator_groups/5 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE https://{baseurl}/api/v2/elevator_groups/5 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/elevator_groups/5
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/elevator_groups/5",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/v2/elevator_groups/5',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/v2/elevator_groups/5");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/v2/elevator_groups/5',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/elevator_groups/5';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/elevator_groups/5', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/elevator_groups/5",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/v2/elevator_groups/5");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/v2/elevator_groups/5",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/elevator_groups/5"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("DELETE", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/elevator_groups/5")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/elevator_groups/5",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/elevator_groups/5');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/elevator_groups/5');

            $request->setRequestMethod('DELETE');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/elevator_groups/5")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/v2/elevator_groups/5")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/elevator_groups/5\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/elevator_groups/5");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/elevator_groups/5"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/elevator_groups/5")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/elevator_groups/5");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/v2/elevator_groups/5"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/elevator_groups/5' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/elevator_groups/5' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/elevator_groups/5"


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/elevator_groups/5"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/elevator_groups/5")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/elevators:
    post:
      tags:
        - Elevators
      summary: Create Elevator
      operationId: createElevator
      description: >-
        This API is used to create elevator.


        The minimum values is name, `elevator_group_id`(id, name),
        `reader_devices`(id, name), `control_device_id`(id, name,
        device_type_id), `floors`(name, order, elevator_device_id, relay_index).
        The rest can be removed.


        **Controller - `control_device_id`**


        Select a device that controls the elevator access permission.


        - Only a master device can be selected.
            
        - You can select it from the list of registered devices.

        **Reader - `reader_devices`**

        Select a device you intend to use for authentication.


        - You can select a device among the master device, slave device, and
        Wiegand device.
            
        - You can select up to 4 readers.
            
        - OM-120 cannot be set as the reader.
            

        **Module - `module_devices`**


        Select OM-120 to control the elevator button relay.


        - Only OM-120 can be selected.
            

        **Total Number of Floors - `floors`**


        Enter the total number of floors that you can move using the elevator.


        - Up to 192 floors can be entered.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Elevator:
                  $ref: '#/components/schemas/Elevator'
              example:
                Elevator:
                  name: Odds
                  description: Odds elevator
                  elevator_group_id:
                    id: 6
                    name: New Elevator Group 2
                  reader_devices:
                    - device_id:
                        id: '544140034'
                        name: BioEntry W2 544140034 (192.168.1.24)
                  control_device_id:
                    id: '544140034'
                    name: BioEntry W2 544140034 (192.168.1.24)
                    device_type_id:
                      id: '13'
                      name: BioEntry W2
                  floors:
                    - name: Odds - 1
                      elevator_device_id:
                        device_id:
                          id: 788930600
                          name: OM-120 788930600
                        relay_index: 0
                      order: 0
                    - name: Odds - 2
                      elevator_device_id:
                        device_id:
                          id: 788930600
                          name: OM-120 788930600
                        relay_index: 1
                      order: 1
                    - name: Odds - 3
                      elevator_device_id:
                        device_id:
                          id: 788930600
                          name: OM-120 788930600
                        relay_index: 2
                      order: 2
                    - name: Odds - 4
                      elevator_device_id:
                        device_id:
                          id: 788930600
                          name: OM-120 788930600
                        relay_index: 3
                      order: 3
                  module_devices:
                    - device_id:
                        id: '788930600'
                        name: OM-120 788930600
                  trigger_actions: []
                  active_timeout: '10'
                  dual_authentication:
                    device: 0
                    approval_type: '0'
                    timeout: 15
                    schedule_id:
                      id: '1'
                    approval_groups: []
                  tamper_device:
                    device_id: {}
                    switch_type: '0'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/elevators \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Elevator":{"name":"Odds","description":"Odds elevator","elevator_group_id":{"id":6,"name":"New Elevator Group 2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry W2"}},"floors":[{"name":"Odds - 1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":0},"order":0},{"name":"Odds - 2","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":1},"order":1},{"name":"Odds - 3","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":2},"order":2},{"name":"Odds - 4","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":3},"order":3}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120 788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"Elevator":{"name":"Odds","description":"Odds
            elevator","elevator_group_id":{"id":6,"name":"New Elevator Group
            2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry
            W2"}},"floors":[{"name":"Odds -
            1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":0},"order":0},{"name":"Odds -
            2","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":1},"order":1},{"name":"Odds -
            3","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":2},"order":2},{"name":"Odds -
            4","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":3},"order":3}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120
            788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
            |  \
              http POST https://{baseurl}/api/elevators \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Elevator":{"name":"Odds","description":"Odds elevator","elevator_group_id":{"id":6,"name":"New Elevator Group 2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry W2"}},"floors":[{"name":"Odds - 1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":0},"order":0},{"name":"Odds - 2","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":1},"order":1},{"name":"Odds - 3","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":2},"order":2},{"name":"Odds - 4","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":3},"order":3}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120 788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}' \
              --output-document \
              - https://{baseurl}/api/elevators
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevators",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Elevator: {
                name: 'Odds',
                description: 'Odds elevator',
                elevator_group_id: {id: 6, name: 'New Elevator Group 2'},
                reader_devices: [{device_id: {id: '544140034', name: 'BioEntry W2 544140034 (192.168.1.24)'}}],
                control_device_id: {
                  id: '544140034',
                  name: 'BioEntry W2 544140034 (192.168.1.24)',
                  device_type_id: {id: '13', name: 'BioEntry W2'}
                },
                floors: [
                  {
                    name: 'Odds - 1',
                    elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 0},
                    order: 0
                  },
                  {
                    name: 'Odds - 2',
                    elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 1},
                    order: 1
                  },
                  {
                    name: 'Odds - 3',
                    elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 2},
                    order: 2
                  },
                  {
                    name: 'Odds - 4',
                    elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 3},
                    order: 3
                  }
                ],
                module_devices: [{device_id: {id: '788930600', name: 'OM-120 788930600'}}],
                trigger_actions: [],
                active_timeout: '10',
                dual_authentication: {
                  device: 0,
                  approval_type: '0',
                  timeout: 15,
                  schedule_id: {id: '1'},
                  approval_groups: []
                },
                tamper_device: {device_id: {}, switch_type: '0'}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Elevator: {
                  name: 'Odds',
                  description: 'Odds elevator',
                  elevator_group_id: {id: 6, name: 'New Elevator Group 2'},
                  reader_devices: [{device_id: {id: '544140034', name: 'BioEntry W2 544140034 (192.168.1.24)'}}],
                  control_device_id: {
                    id: '544140034',
                    name: 'BioEntry W2 544140034 (192.168.1.24)',
                    device_type_id: {id: '13', name: 'BioEntry W2'}
                  },
                  floors: [
                    {
                      name: 'Odds - 1',
                      elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 0},
                      order: 0
                    },
                    {
                      name: 'Odds - 2',
                      elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 1},
                      order: 1
                    },
                    {
                      name: 'Odds - 3',
                      elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 2},
                      order: 2
                    },
                    {
                      name: 'Odds - 4',
                      elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 3},
                      order: 3
                    }
                  ],
                  module_devices: [{device_id: {id: '788930600', name: 'OM-120 788930600'}}],
                  trigger_actions: [],
                  active_timeout: '10',
                  dual_authentication: {
                    device: 0,
                    approval_type: '0',
                    timeout: 15,
                    schedule_id: {id: '1'},
                    approval_groups: []
                  },
                  tamper_device: {device_id: {}, switch_type: '0'}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/elevators");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Elevator": {
                "name": "Odds",
                "description": "Odds elevator",
                "elevator_group_id": {
                  "id": 6,
                  "name": "New Elevator Group 2"
                },
                "reader_devices": [
                  {
                    "device_id": {
                      "id": "544140034",
                      "name": "BioEntry W2 544140034 (192.168.1.24)"
                    }
                  }
                ],
                "control_device_id": {
                  "id": "544140034",
                  "name": "BioEntry W2 544140034 (192.168.1.24)",
                  "device_type_id": {
                    "id": "13",
                    "name": "BioEntry W2"
                  }
                },
                "floors": [
                  {
                    "name": "Odds - 1",
                    "elevator_device_id": {
                      "device_id": {
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      },
                      "relay_index": 0
                    },
                    "order": 0
                  },
                  {
                    "name": "Odds - 2",
                    "elevator_device_id": {
                      "device_id": {
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      },
                      "relay_index": 1
                    },
                    "order": 1
                  },
                  {
                    "name": "Odds - 3",
                    "elevator_device_id": {
                      "device_id": {
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      },
                      "relay_index": 2
                    },
                    "order": 2
                  },
                  {
                    "name": "Odds - 4",
                    "elevator_device_id": {
                      "device_id": {
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      },
                      "relay_index": 3
                    },
                    "order": 3
                  }
                ],
                "module_devices": [
                  {
                    "device_id": {
                      "id": "788930600",
                      "name": "OM-120 788930600"
                    }
                  }
                ],
                "trigger_actions": [],
                "active_timeout": "10",
                "dual_authentication": {
                  "device": 0,
                  "approval_type": "0",
                  "timeout": 15,
                  "schedule_id": {
                    "id": "1"
                  },
                  "approval_groups": []
                },
                "tamper_device": {
                  "device_id": {},
                  "switch_type": "0"
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Elevator: {
                  name: 'Odds',
                  description: 'Odds elevator',
                  elevator_group_id: {id: 6, name: 'New Elevator Group 2'},
                  reader_devices: [{device_id: {id: '544140034', name: 'BioEntry W2 544140034 (192.168.1.24)'}}],
                  control_device_id: {
                    id: '544140034',
                    name: 'BioEntry W2 544140034 (192.168.1.24)',
                    device_type_id: {id: '13', name: 'BioEntry W2'}
                  },
                  floors: [
                    {
                      name: 'Odds - 1',
                      elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 0},
                      order: 0
                    },
                    {
                      name: 'Odds - 2',
                      elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 1},
                      order: 1
                    },
                    {
                      name: 'Odds - 3',
                      elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 2},
                      order: 2
                    },
                    {
                      name: 'Odds - 4',
                      elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 3},
                      order: 3
                    }
                  ],
                  module_devices: [{device_id: {id: '788930600', name: 'OM-120 788930600'}}],
                  trigger_actions: [],
                  active_timeout: '10',
                  dual_authentication: {
                    device: 0,
                    approval_type: '0',
                    timeout: 15,
                    schedule_id: {id: '1'},
                    approval_groups: []
                  },
                  tamper_device: {device_id: {}, switch_type: '0'}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/elevators';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Elevator":{"name":"Odds","description":"Odds elevator","elevator_group_id":{"id":6,"name":"New Elevator Group 2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry W2"}},"floors":[{"name":"Odds - 1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":0},"order":0},{"name":"Odds - 2","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":1},"order":1},{"name":"Odds - 3","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":2},"order":2},{"name":"Odds - 4","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":3},"order":3}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120 788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Elevator":{"name":"Odds","description":"Odds elevator","elevator_group_id":{"id":6,"name":"New Elevator Group 2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry W2"}},"floors":[{"name":"Odds - 1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":0},"order":0},{"name":"Odds - 2","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":1},"order":1},{"name":"Odds - 3","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":2},"order":2},{"name":"Odds - 4","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":3},"order":3}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120 788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
            };

            fetch('https://{baseurl}/api/elevators', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevators",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator Group 2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry W2\"}},\"floors\":[{\"name\":\"Odds - 1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds - 2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds - 3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds - 4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120 788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Elevator": {
                "name": "Odds",
                "description": "Odds elevator",
                "elevator_group_id": {
                  "id": 6,
                  "name": "New Elevator Group 2"
                },
                "reader_devices": [
                  {
                    "device_id": {
                      "id": "544140034",
                      "name": "BioEntry W2 544140034 (192.168.1.24)"
                    }
                  }
                ],
                "control_device_id": {
                  "id": "544140034",
                  "name": "BioEntry W2 544140034 (192.168.1.24)",
                  "device_type_id": {
                    "id": "13",
                    "name": "BioEntry W2"
                  }
                },
                "floors": [
                  {
                    "name": "Odds - 1",
                    "elevator_device_id": {
                      "device_id": {
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      },
                      "relay_index": 0
                    },
                    "order": 0
                  },
                  {
                    "name": "Odds - 2",
                    "elevator_device_id": {
                      "device_id": {
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      },
                      "relay_index": 1
                    },
                    "order": 1
                  },
                  {
                    "name": "Odds - 3",
                    "elevator_device_id": {
                      "device_id": {
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      },
                      "relay_index": 2
                    },
                    "order": 2
                  },
                  {
                    "name": "Odds - 4",
                    "elevator_device_id": {
                      "device_id": {
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      },
                      "relay_index": 3
                    },
                    "order": 3
                  }
                ],
                "module_devices": [
                  {
                    "device_id": {
                      "id": "788930600",
                      "name": "OM-120 788930600"
                    }
                  }
                ],
                "trigger_actions": [],
                "active_timeout": "10",
                "dual_authentication": {
                  "device": 0,
                  "approval_type": "0",
                  "timeout": 15,
                  "schedule_id": {
                    "id": "1"
                  },
                  "approval_groups": []
                },
                "tamper_device": {
                  "device_id": {},
                  "switch_type": "0"
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/elevators");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds -
            2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds -
            3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds -
            4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/elevators", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/elevators"


            payload = {"Elevator": {
                    "name": "Odds",
                    "description": "Odds elevator",
                    "elevator_group_id": {
                        "id": 6,
                        "name": "New Elevator Group 2"
                    },
                    "reader_devices": [{"device_id": {
                                "id": "544140034",
                                "name": "BioEntry W2 544140034 (192.168.1.24)"
                            }}],
                    "control_device_id": {
                        "id": "544140034",
                        "name": "BioEntry W2 544140034 (192.168.1.24)",
                        "device_type_id": {
                            "id": "13",
                            "name": "BioEntry W2"
                        }
                    },
                    "floors": [
                        {
                            "name": "Odds - 1",
                            "elevator_device_id": {
                                "device_id": {
                                    "id": 788930600,
                                    "name": "OM-120 788930600"
                                },
                                "relay_index": 0
                            },
                            "order": 0
                        },
                        {
                            "name": "Odds - 2",
                            "elevator_device_id": {
                                "device_id": {
                                    "id": 788930600,
                                    "name": "OM-120 788930600"
                                },
                                "relay_index": 1
                            },
                            "order": 1
                        },
                        {
                            "name": "Odds - 3",
                            "elevator_device_id": {
                                "device_id": {
                                    "id": 788930600,
                                    "name": "OM-120 788930600"
                                },
                                "relay_index": 2
                            },
                            "order": 2
                        },
                        {
                            "name": "Odds - 4",
                            "elevator_device_id": {
                                "device_id": {
                                    "id": 788930600,
                                    "name": "OM-120 788930600"
                                },
                                "relay_index": 3
                            },
                            "order": 3
                        }
                    ],
                    "module_devices": [{"device_id": {
                                "id": "788930600",
                                "name": "OM-120 788930600"
                            }}],
                    "trigger_actions": [],
                    "active_timeout": "10",
                    "dual_authentication": {
                        "device": 0,
                        "approval_type": "0",
                        "timeout": 15,
                        "schedule_id": {"id": "1"},
                        "approval_groups": []
                    },
                    "tamper_device": {
                        "device_id": {},
                        "switch_type": "0"
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/elevators")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds -
            2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds -
            3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds -
            4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevators",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator Group 2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry W2\"}},\"floors\":[{\"name\":\"Odds - 1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds - 2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds - 3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds - 4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120 788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/elevators');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Elevator":{"name":"Odds","description":"Odds
            elevator","elevator_group_id":{"id":6,"name":"New Elevator Group
            2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry
            W2"}},"floors":[{"name":"Odds -
            1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":0},"order":0},{"name":"Odds -
            2","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":1},"order":1},{"name":"Odds -
            3","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":2},"order":2},{"name":"Odds -
            4","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":3},"order":3}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120
            788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Elevator":{"name":"Odds","description":"Odds
            elevator","elevator_group_id":{"id":6,"name":"New Elevator Group
            2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry
            W2"}},"floors":[{"name":"Odds -
            1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":0},"order":0},{"name":"Odds -
            2","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":1},"order":1},{"name":"Odds -
            3","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":2},"order":2},{"name":"Odds -
            4","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":3},"order":3}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120
            788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}');


            $request->setRequestUrl('https://{baseurl}/api/elevators');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds -
            2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds -
            3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds -
            4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevators")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/elevators")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator Group 2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry W2\"}},\"floors\":[{\"name\":\"Odds - 1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds - 2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds - 3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds - 4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120 788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevators\"\n\n\tpayload := strings.NewReader(\"{\\\"Elevator\\\":{\\\"name\\\":\\\"Odds\\\",\\\"description\\\":\\\"Odds elevator\\\",\\\"elevator_group_id\\\":{\\\"id\\\":6,\\\"name\\\":\\\"New Elevator Group 2\\\"},\\\"reader_devices\\\":[{\\\"device_id\\\":{\\\"id\\\":\\\"544140034\\\",\\\"name\\\":\\\"BioEntry W2 544140034 (192.168.1.24)\\\"}}],\\\"control_device_id\\\":{\\\"id\\\":\\\"544140034\\\",\\\"name\\\":\\\"BioEntry W2 544140034 (192.168.1.24)\\\",\\\"device_type_id\\\":{\\\"id\\\":\\\"13\\\",\\\"name\\\":\\\"BioEntry W2\\\"}},\\\"floors\\\":[{\\\"name\\\":\\\"Odds - 1\\\",\\\"elevator_device_id\\\":{\\\"device_id\\\":{\\\"id\\\":788930600,\\\"name\\\":\\\"OM-120 788930600\\\"},\\\"relay_index\\\":0},\\\"order\\\":0},{\\\"name\\\":\\\"Odds - 2\\\",\\\"elevator_device_id\\\":{\\\"device_id\\\":{\\\"id\\\":788930600,\\\"name\\\":\\\"OM-120 788930600\\\"},\\\"relay_index\\\":1},\\\"order\\\":1},{\\\"name\\\":\\\"Odds - 3\\\",\\\"elevator_device_id\\\":{\\\"device_id\\\":{\\\"id\\\":788930600,\\\"name\\\":\\\"OM-120 788930600\\\"},\\\"relay_index\\\":2},\\\"order\\\":2},{\\\"name\\\":\\\"Odds - 4\\\",\\\"elevator_device_id\\\":{\\\"device_id\\\":{\\\"id\\\":788930600,\\\"name\\\":\\\"OM-120 788930600\\\"},\\\"relay_index\\\":3},\\\"order\\\":3}],\\\"module_devices\\\":[{\\\"device_id\\\":{\\\"id\\\":\\\"788930600\\\",\\\"name\\\":\\\"OM-120 788930600\\\"}}],\\\"trigger_actions\\\":[],\\\"active_timeout\\\":\\\"10\\\",\\\"dual_authentication\\\":{\\\"device\\\":0,\\\"approval_type\\\":\\\"0\\\",\\\"timeout\\\":15,\\\"schedule_id\\\":{\\\"id\\\":\\\"1\\\"},\\\"approval_groups\\\":[]},\\\"tamper_device\\\":{\\\"device_id\\\":{},\\\"switch_type\\\":\\\"0\\\"}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevators");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds -
            2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds -
            3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds -
            4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Elevator": @{ @"name": @"Odds",
            @"description": @"Odds elevator", @"elevator_group_id": @{ @"id":
            @6, @"name": @"New Elevator Group 2" }, @"reader_devices": @[ @{
            @"device_id": @{ @"id": @"544140034", @"name": @"BioEntry W2
            544140034 (192.168.1.24)" } } ], @"control_device_id": @{ @"id":
            @"544140034", @"name": @"BioEntry W2 544140034 (192.168.1.24)",
            @"device_type_id": @{ @"id": @"13", @"name": @"BioEntry W2" } },
            @"floors": @[ @{ @"name": @"Odds - 1", @"elevator_device_id": @{
            @"device_id": @{ @"id": @788930600, @"name": @"OM-120 788930600" },
            @"relay_index": @0 }, @"order": @0 }, @{ @"name": @"Odds - 2",
            @"elevator_device_id": @{ @"device_id": @{ @"id": @788930600,
            @"name": @"OM-120 788930600" }, @"relay_index": @1 }, @"order": @1
            }, @{ @"name": @"Odds - 3", @"elevator_device_id": @{ @"device_id":
            @{ @"id": @788930600, @"name": @"OM-120 788930600" },
            @"relay_index": @2 }, @"order": @2 }, @{ @"name": @"Odds - 4",
            @"elevator_device_id": @{ @"device_id": @{ @"id": @788930600,
            @"name": @"OM-120 788930600" }, @"relay_index": @3 }, @"order": @3 }
            ], @"module_devices": @[ @{ @"device_id": @{ @"id": @"788930600",
            @"name": @"OM-120 788930600" } } ], @"trigger_actions": @[  ],
            @"active_timeout": @"10", @"dual_authentication": @{ @"device": @0,
            @"approval_type": @"0", @"timeout": @15, @"schedule_id": @{ @"id":
            @"1" }, @"approval_groups": @[  ] }, @"tamper_device": @{
            @"device_id": @{  }, @"switch_type": @"0" } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevators"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Elevator": [
                "name": "Odds",
                "description": "Odds elevator",
                "elevator_group_id": [
                  "id": 6,
                  "name": "New Elevator Group 2"
                ],
                "reader_devices": [["device_id": [
                      "id": "544140034",
                      "name": "BioEntry W2 544140034 (192.168.1.24)"
                    ]]],
                "control_device_id": [
                  "id": "544140034",
                  "name": "BioEntry W2 544140034 (192.168.1.24)",
                  "device_type_id": [
                    "id": "13",
                    "name": "BioEntry W2"
                  ]
                ],
                "floors": [
                  [
                    "name": "Odds - 1",
                    "elevator_device_id": [
                      "device_id": [
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      ],
                      "relay_index": 0
                    ],
                    "order": 0
                  ],
                  [
                    "name": "Odds - 2",
                    "elevator_device_id": [
                      "device_id": [
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      ],
                      "relay_index": 1
                    ],
                    "order": 1
                  ],
                  [
                    "name": "Odds - 3",
                    "elevator_device_id": [
                      "device_id": [
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      ],
                      "relay_index": 2
                    ],
                    "order": 2
                  ],
                  [
                    "name": "Odds - 4",
                    "elevator_device_id": [
                      "device_id": [
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      ],
                      "relay_index": 3
                    ],
                    "order": 3
                  ]
                ],
                "module_devices": [["device_id": [
                      "id": "788930600",
                      "name": "OM-120 788930600"
                    ]]],
                "trigger_actions": [],
                "active_timeout": "10",
                "dual_authentication": [
                  "device": 0,
                  "approval_type": "0",
                  "timeout": 15,
                  "schedule_id": ["id": "1"],
                  "approval_groups": []
                ],
                "tamper_device": [
                  "device_id": [],
                  "switch_type": "0"
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevators")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/elevators");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds -
            2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds -
            3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds -
            4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/elevators"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator Group 2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry W2\"}},\"floors\":[{\"name\":\"Odds - 1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds - 2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds - 3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds - 4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120 788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/elevators'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Elevator":{"name":"Odds","description":"Odds
            elevator","elevator_group_id":{"id":6,"name":"New Elevator Group
            2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry
            W2"}},"floors":[{"name":"Odds -
            1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":0},"order":0},{"name":"Odds -
            2","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":1},"order":1},{"name":"Odds -
            3","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":2},"order":2},{"name":"Odds -
            4","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":3},"order":3}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120
            788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/elevators'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Elevator":{"name":"Odds","description":"Odds
            elevator","elevator_group_id":{"id":6,"name":"New Elevator Group
            2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry
            W2"}},"floors":[{"name":"Odds -
            1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":0},"order":0},{"name":"Odds -
            2","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":1},"order":1},{"name":"Odds -
            3","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":2},"order":2},{"name":"Odds -
            4","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":3},"order":3}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120
            788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevators"


            payload <- "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds -
            2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds -
            3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds -
            4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/elevators" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds -
            2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds -
            3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds -
            4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0},{\"name\":\"Odds -
            2\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":1},\"order\":1},{\"name\":\"Odds -
            3\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":2},\"order\":2},{\"name\":\"Odds -
            4\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":3},\"order\":3}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevators")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Elevators
      summary: Delete Elevator
      operationId: deleteElevator
      description: This API is used to delete elevator.
      parameters:
        - name: id
          in: query
          schema:
            type: string
          description: ID of the elevator which will be deleted
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/elevators?id=SOME_STRING_VALUE' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE 'https://{baseurl}/api/elevators?id=SOME_STRING_VALUE' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/elevators?id=SOME_STRING_VALUE'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevators?id=SOME_STRING_VALUE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/elevators',
              qs: {id: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("DELETE", "https://{baseurl}/api/elevators");

            req.query({
              "id": "SOME_STRING_VALUE"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/elevators',
              params: {id: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/elevators?id=SOME_STRING_VALUE';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/elevators?id=SOME_STRING_VALUE',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevators?id=SOME_STRING_VALUE",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("DELETE",
            "https://{baseurl}/api/elevators?id=SOME_STRING_VALUE");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE",
            "{baseurl}/api/elevators?id=SOME_STRING_VALUE", headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/elevators"


            querystring = {"id":"SOME_STRING_VALUE"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/elevators?id=SOME_STRING_VALUE")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevators?id=SOME_STRING_VALUE",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/elevators');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/elevators');
            $request->setRequestMethod('DELETE');
            $request->setQuery(new http\QueryString([
              'id' => 'SOME_STRING_VALUE'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevators?id=SOME_STRING_VALUE")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/elevators?id=SOME_STRING_VALUE")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevators?id=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevators?id=SOME_STRING_VALUE");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevators?id=SOME_STRING_VALUE"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevators?id=SOME_STRING_VALUE")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/elevators?id=SOME_STRING_VALUE");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/elevators?id=SOME_STRING_VALUE"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/elevators?id=SOME_STRING_VALUE' -Method
            DELETE -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/elevators?id=SOME_STRING_VALUE' -Method
            DELETE -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevators"


            queryString <- list([ 'id' ] = "SOME_STRING_VALUE")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/elevators?id=SOME_STRING_VALUE" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevators?id=SOME_STRING_VALUE")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/elevators/search:
    post:
      tags:
        - Elevators
      summary: List Elevators
      operationId: searchElevatorSearch
      description: |-
        This API is used to list elevators recorder in BioStar X

        It is required to at least put {} for the API to run correctly.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                limit:
                  type: integer
                  description: >-
                    Limit the response records by the number specified on this
                    parameter
                  example: 50
                search_text:
                  type: string
                  description: Search records based on the value specified
                  example: Odds
                elevator_group_id:
                  type: integer
                  description: List elevators with specified group id
                  example: 1
                order_by:
                  type: string
                  description: Sort response by specified value
                  example: elevator_group_id:false
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/elevators/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"limit":50,"search_text":"Odds","elevator_group_id":1,"order_by":"elevator_group_id:false"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"limit":50,"search_text":"Odds","elevator_group_id":1,"order_by":"elevator_group_id:false"}'
            |  \
              http POST https://{baseurl}/api/v2/elevators/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"limit":50,"search_text":"Odds","elevator_group_id":1,"order_by":"elevator_group_id:false"}' \
              --output-document \
              - https://{baseurl}/api/v2/elevators/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/elevators/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              limit: 50,
              search_text: 'Odds',
              elevator_group_id: 1,
              order_by: 'elevator_group_id:false'
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/elevators/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                limit: 50,
                search_text: 'Odds',
                elevator_group_id: 1,
                order_by: 'elevator_group_id:false'
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/elevators/search");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "limit": 50,
              "search_text": "Odds",
              "elevator_group_id": 1,
              "order_by": "elevator_group_id:false"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/elevators/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                limit: 50,
                search_text: 'Odds',
                elevator_group_id: 1,
                order_by: 'elevator_group_id:false'
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/elevators/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":50,"search_text":"Odds","elevator_group_id":1,"order_by":"elevator_group_id:false"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"limit":50,"search_text":"Odds","elevator_group_id":1,"order_by":"elevator_group_id:false"}'
            };

            fetch('https://{baseurl}/api/v2/elevators/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/elevators/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "limit": 50,
              "search_text": "Odds",
              "elevator_group_id": 1,
              "order_by": "elevator_group_id:false"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/elevators/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/elevators/search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/elevators/search"


            payload = {
                "limit": 50,
                "search_text": "Odds",
                "elevator_group_id": 1,
                "order_by": "elevator_group_id:false"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/elevators/search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/elevators/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/elevators/search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"limit":50,"search_text":"Odds","elevator_group_id":1,"order_by":"elevator_group_id:false"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"limit":50,"search_text":"Odds","elevator_group_id":1,"order_by":"elevator_group_id:false"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/elevators/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/elevators/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/elevators/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/elevators/search\"\n\n\tpayload := strings.NewReader(\"{\\\"limit\\\":50,\\\"search_text\\\":\\\"Odds\\\",\\\"elevator_group_id\\\":1,\\\"order_by\\\":\\\"elevator_group_id:false\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/elevators/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"limit": @50,
                                          @"search_text": @"Odds",
                                          @"elevator_group_id": @1,
                                          @"order_by": @"elevator_group_id:false" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/elevators/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "limit": 50,
              "search_text": "Odds",
              "elevator_group_id": 1,
              "order_by": "elevator_group_id:false"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/elevators/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/elevators/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/elevators/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/elevators/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"limit":50,"search_text":"Odds","elevator_group_id":1,"order_by":"elevator_group_id:false"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/elevators/search' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"limit":50,"search_text":"Odds","elevator_group_id":1,"order_by":"elevator_group_id:false"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/elevators/search"


            payload <-
            "{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/elevators/search"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"limit\":50,\"search_text\":\"Odds\",\"elevator_group_id\":1,\"order_by\":\"elevator_group_id:false\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/elevators/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/elevators/{id}:
    get:
      tags:
        - Elevators
      summary: View an Elevator Details
      operationId: listElevator
      description: This API is used to view an elevator details.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the elevator which will be viewed
          example: 32770
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/elevators/32770 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/elevators/32770 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/elevators/32770
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevators/32770",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/elevators/32770',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/elevators/32770");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/elevators/32770',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/elevators/32770';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/elevators/32770', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevators/32770",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/elevators/32770");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/elevators/32770",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/elevators/32770"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/elevators/32770")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevators/32770",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/elevators/32770');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/elevators/32770');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevators/32770")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/elevators/32770")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevators/32770\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevators/32770");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevators/32770"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevators/32770")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/elevators/32770");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/elevators/32770"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/elevators/32770' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/elevators/32770' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevators/32770"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/elevators/32770" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevators/32770")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    put:
      tags:
        - Elevators
      summary: Update Elevator
      operationId: updateElevator
      description: |-
        This API is used to update an elevator configuration.

        Leave values which will be edited and remove everything else.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Elevator:
                  $ref: '#/components/schemas/Elevator'
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the elevator which will be updated
          example: 32771
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/elevators/32771 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Elevator":{"name":"Odds","description":"Odds elevator","elevator_group_id":{"id":6,"name":"New Elevator Group 2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry W2"}},"floors":[{"name":"Odds - 1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":0},"order":0}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120 788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"Elevator":{"name":"Odds","description":"Odds
            elevator","elevator_group_id":{"id":6,"name":"New Elevator Group
            2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry
            W2"}},"floors":[{"name":"Odds -
            1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":0},"order":0}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120
            788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
            |  \
              http PUT https://{baseurl}/api/elevators/32771 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Elevator":{"name":"Odds","description":"Odds elevator","elevator_group_id":{"id":6,"name":"New Elevator Group 2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry W2"}},"floors":[{"name":"Odds - 1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":0},"order":0}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120 788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}' \
              --output-document \
              - https://{baseurl}/api/elevators/32771
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevators/32771",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Elevator: {
                name: 'Odds',
                description: 'Odds elevator',
                elevator_group_id: {id: 6, name: 'New Elevator Group 2'},
                reader_devices: [{device_id: {id: '544140034', name: 'BioEntry W2 544140034 (192.168.1.24)'}}],
                control_device_id: {
                  id: '544140034',
                  name: 'BioEntry W2 544140034 (192.168.1.24)',
                  device_type_id: {id: '13', name: 'BioEntry W2'}
                },
                floors: [
                  {
                    name: 'Odds - 1',
                    elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 0},
                    order: 0
                  }
                ],
                module_devices: [{device_id: {id: '788930600', name: 'OM-120 788930600'}}],
                trigger_actions: [],
                active_timeout: '10',
                dual_authentication: {
                  device: 0,
                  approval_type: '0',
                  timeout: 15,
                  schedule_id: {id: '1'},
                  approval_groups: []
                },
                tamper_device: {device_id: {}, switch_type: '0'}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/elevators/32771',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Elevator: {
                  name: 'Odds',
                  description: 'Odds elevator',
                  elevator_group_id: {id: 6, name: 'New Elevator Group 2'},
                  reader_devices: [{device_id: {id: '544140034', name: 'BioEntry W2 544140034 (192.168.1.24)'}}],
                  control_device_id: {
                    id: '544140034',
                    name: 'BioEntry W2 544140034 (192.168.1.24)',
                    device_type_id: {id: '13', name: 'BioEntry W2'}
                  },
                  floors: [
                    {
                      name: 'Odds - 1',
                      elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 0},
                      order: 0
                    }
                  ],
                  module_devices: [{device_id: {id: '788930600', name: 'OM-120 788930600'}}],
                  trigger_actions: [],
                  active_timeout: '10',
                  dual_authentication: {
                    device: 0,
                    approval_type: '0',
                    timeout: 15,
                    schedule_id: {id: '1'},
                    approval_groups: []
                  },
                  tamper_device: {device_id: {}, switch_type: '0'}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/elevators/32771");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Elevator": {
                "name": "Odds",
                "description": "Odds elevator",
                "elevator_group_id": {
                  "id": 6,
                  "name": "New Elevator Group 2"
                },
                "reader_devices": [
                  {
                    "device_id": {
                      "id": "544140034",
                      "name": "BioEntry W2 544140034 (192.168.1.24)"
                    }
                  }
                ],
                "control_device_id": {
                  "id": "544140034",
                  "name": "BioEntry W2 544140034 (192.168.1.24)",
                  "device_type_id": {
                    "id": "13",
                    "name": "BioEntry W2"
                  }
                },
                "floors": [
                  {
                    "name": "Odds - 1",
                    "elevator_device_id": {
                      "device_id": {
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      },
                      "relay_index": 0
                    },
                    "order": 0
                  }
                ],
                "module_devices": [
                  {
                    "device_id": {
                      "id": "788930600",
                      "name": "OM-120 788930600"
                    }
                  }
                ],
                "trigger_actions": [],
                "active_timeout": "10",
                "dual_authentication": {
                  "device": 0,
                  "approval_type": "0",
                  "timeout": 15,
                  "schedule_id": {
                    "id": "1"
                  },
                  "approval_groups": []
                },
                "tamper_device": {
                  "device_id": {},
                  "switch_type": "0"
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/elevators/32771',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Elevator: {
                  name: 'Odds',
                  description: 'Odds elevator',
                  elevator_group_id: {id: 6, name: 'New Elevator Group 2'},
                  reader_devices: [{device_id: {id: '544140034', name: 'BioEntry W2 544140034 (192.168.1.24)'}}],
                  control_device_id: {
                    id: '544140034',
                    name: 'BioEntry W2 544140034 (192.168.1.24)',
                    device_type_id: {id: '13', name: 'BioEntry W2'}
                  },
                  floors: [
                    {
                      name: 'Odds - 1',
                      elevator_device_id: {device_id: {id: 788930600, name: 'OM-120 788930600'}, relay_index: 0},
                      order: 0
                    }
                  ],
                  module_devices: [{device_id: {id: '788930600', name: 'OM-120 788930600'}}],
                  trigger_actions: [],
                  active_timeout: '10',
                  dual_authentication: {
                    device: 0,
                    approval_type: '0',
                    timeout: 15,
                    schedule_id: {id: '1'},
                    approval_groups: []
                  },
                  tamper_device: {device_id: {}, switch_type: '0'}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/elevators/32771';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Elevator":{"name":"Odds","description":"Odds elevator","elevator_group_id":{"id":6,"name":"New Elevator Group 2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry W2"}},"floors":[{"name":"Odds - 1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":0},"order":0}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120 788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Elevator":{"name":"Odds","description":"Odds elevator","elevator_group_id":{"id":6,"name":"New Elevator Group 2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry W2 544140034 (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry W2"}},"floors":[{"name":"Odds - 1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120 788930600"},"relay_index":0},"order":0}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120 788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
            };

            fetch('https://{baseurl}/api/elevators/32771', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevators/32771",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator Group 2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry W2\"}},\"floors\":[{\"name\":\"Odds - 1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120 788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Elevator": {
                "name": "Odds",
                "description": "Odds elevator",
                "elevator_group_id": {
                  "id": 6,
                  "name": "New Elevator Group 2"
                },
                "reader_devices": [
                  {
                    "device_id": {
                      "id": "544140034",
                      "name": "BioEntry W2 544140034 (192.168.1.24)"
                    }
                  }
                ],
                "control_device_id": {
                  "id": "544140034",
                  "name": "BioEntry W2 544140034 (192.168.1.24)",
                  "device_type_id": {
                    "id": "13",
                    "name": "BioEntry W2"
                  }
                },
                "floors": [
                  {
                    "name": "Odds - 1",
                    "elevator_device_id": {
                      "device_id": {
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      },
                      "relay_index": 0
                    },
                    "order": 0
                  }
                ],
                "module_devices": [
                  {
                    "device_id": {
                      "id": "788930600",
                      "name": "OM-120 788930600"
                    }
                  }
                ],
                "trigger_actions": [],
                "active_timeout": "10",
                "dual_authentication": {
                  "device": 0,
                  "approval_type": "0",
                  "timeout": 15,
                  "schedule_id": {
                    "id": "1"
                  },
                  "approval_groups": []
                },
                "tamper_device": {
                  "device_id": {},
                  "switch_type": "0"
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/elevators/32771");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/elevators/32771", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/elevators/32771"


            payload = {"Elevator": {
                    "name": "Odds",
                    "description": "Odds elevator",
                    "elevator_group_id": {
                        "id": 6,
                        "name": "New Elevator Group 2"
                    },
                    "reader_devices": [{"device_id": {
                                "id": "544140034",
                                "name": "BioEntry W2 544140034 (192.168.1.24)"
                            }}],
                    "control_device_id": {
                        "id": "544140034",
                        "name": "BioEntry W2 544140034 (192.168.1.24)",
                        "device_type_id": {
                            "id": "13",
                            "name": "BioEntry W2"
                        }
                    },
                    "floors": [
                        {
                            "name": "Odds - 1",
                            "elevator_device_id": {
                                "device_id": {
                                    "id": 788930600,
                                    "name": "OM-120 788930600"
                                },
                                "relay_index": 0
                            },
                            "order": 0
                        }
                    ],
                    "module_devices": [{"device_id": {
                                "id": "788930600",
                                "name": "OM-120 788930600"
                            }}],
                    "trigger_actions": [],
                    "active_timeout": "10",
                    "dual_authentication": {
                        "device": 0,
                        "approval_type": "0",
                        "timeout": 15,
                        "schedule_id": {"id": "1"},
                        "approval_groups": []
                    },
                    "tamper_device": {
                        "device_id": {},
                        "switch_type": "0"
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/elevators/32771")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevators/32771",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator Group 2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry W2\"}},\"floors\":[{\"name\":\"Odds - 1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120 788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/elevators/32771');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Elevator":{"name":"Odds","description":"Odds
            elevator","elevator_group_id":{"id":6,"name":"New Elevator Group
            2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry
            W2"}},"floors":[{"name":"Odds -
            1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":0},"order":0}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120
            788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Elevator":{"name":"Odds","description":"Odds
            elevator","elevator_group_id":{"id":6,"name":"New Elevator Group
            2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry
            W2"}},"floors":[{"name":"Odds -
            1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":0},"order":0}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120
            788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}');


            $request->setRequestUrl('https://{baseurl}/api/elevators/32771');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevators/32771")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/elevators/32771")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator Group 2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry W2\"}},\"floors\":[{\"name\":\"Odds - 1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120 788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevators/32771\"\n\n\tpayload := strings.NewReader(\"{\\\"Elevator\\\":{\\\"name\\\":\\\"Odds\\\",\\\"description\\\":\\\"Odds elevator\\\",\\\"elevator_group_id\\\":{\\\"id\\\":6,\\\"name\\\":\\\"New Elevator Group 2\\\"},\\\"reader_devices\\\":[{\\\"device_id\\\":{\\\"id\\\":\\\"544140034\\\",\\\"name\\\":\\\"BioEntry W2 544140034 (192.168.1.24)\\\"}}],\\\"control_device_id\\\":{\\\"id\\\":\\\"544140034\\\",\\\"name\\\":\\\"BioEntry W2 544140034 (192.168.1.24)\\\",\\\"device_type_id\\\":{\\\"id\\\":\\\"13\\\",\\\"name\\\":\\\"BioEntry W2\\\"}},\\\"floors\\\":[{\\\"name\\\":\\\"Odds - 1\\\",\\\"elevator_device_id\\\":{\\\"device_id\\\":{\\\"id\\\":788930600,\\\"name\\\":\\\"OM-120 788930600\\\"},\\\"relay_index\\\":0},\\\"order\\\":0}],\\\"module_devices\\\":[{\\\"device_id\\\":{\\\"id\\\":\\\"788930600\\\",\\\"name\\\":\\\"OM-120 788930600\\\"}}],\\\"trigger_actions\\\":[],\\\"active_timeout\\\":\\\"10\\\",\\\"dual_authentication\\\":{\\\"device\\\":0,\\\"approval_type\\\":\\\"0\\\",\\\"timeout\\\":15,\\\"schedule_id\\\":{\\\"id\\\":\\\"1\\\"},\\\"approval_groups\\\":[]},\\\"tamper_device\\\":{\\\"device_id\\\":{},\\\"switch_type\\\":\\\"0\\\"}}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevators/32771");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Elevator": @{ @"name": @"Odds",
            @"description": @"Odds elevator", @"elevator_group_id": @{ @"id":
            @6, @"name": @"New Elevator Group 2" }, @"reader_devices": @[ @{
            @"device_id": @{ @"id": @"544140034", @"name": @"BioEntry W2
            544140034 (192.168.1.24)" } } ], @"control_device_id": @{ @"id":
            @"544140034", @"name": @"BioEntry W2 544140034 (192.168.1.24)",
            @"device_type_id": @{ @"id": @"13", @"name": @"BioEntry W2" } },
            @"floors": @[ @{ @"name": @"Odds - 1", @"elevator_device_id": @{
            @"device_id": @{ @"id": @788930600, @"name": @"OM-120 788930600" },
            @"relay_index": @0 }, @"order": @0 } ], @"module_devices": @[ @{
            @"device_id": @{ @"id": @"788930600", @"name": @"OM-120 788930600" }
            } ], @"trigger_actions": @[  ], @"active_timeout": @"10",
            @"dual_authentication": @{ @"device": @0, @"approval_type": @"0",
            @"timeout": @15, @"schedule_id": @{ @"id": @"1" },
            @"approval_groups": @[  ] }, @"tamper_device": @{ @"device_id": @{ 
            }, @"switch_type": @"0" } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevators/32771"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Elevator": [
                "name": "Odds",
                "description": "Odds elevator",
                "elevator_group_id": [
                  "id": 6,
                  "name": "New Elevator Group 2"
                ],
                "reader_devices": [["device_id": [
                      "id": "544140034",
                      "name": "BioEntry W2 544140034 (192.168.1.24)"
                    ]]],
                "control_device_id": [
                  "id": "544140034",
                  "name": "BioEntry W2 544140034 (192.168.1.24)",
                  "device_type_id": [
                    "id": "13",
                    "name": "BioEntry W2"
                  ]
                ],
                "floors": [
                  [
                    "name": "Odds - 1",
                    "elevator_device_id": [
                      "device_id": [
                        "id": 788930600,
                        "name": "OM-120 788930600"
                      ],
                      "relay_index": 0
                    ],
                    "order": 0
                  ]
                ],
                "module_devices": [["device_id": [
                      "id": "788930600",
                      "name": "OM-120 788930600"
                    ]]],
                "trigger_actions": [],
                "active_timeout": "10",
                "dual_authentication": [
                  "device": 0,
                  "approval_type": "0",
                  "timeout": 15,
                  "schedule_id": ["id": "1"],
                  "approval_groups": []
                ],
                "tamper_device": [
                  "device_id": [],
                  "switch_type": "0"
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevators/32771")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/elevators/32771");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/elevators/32771"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator Group 2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry W2 544140034 (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry W2\"}},\"floors\":[{\"name\":\"Odds - 1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120 788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120 788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/elevators/32771' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"Elevator":{"name":"Odds","description":"Odds
            elevator","elevator_group_id":{"id":6,"name":"New Elevator Group
            2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry
            W2"}},"floors":[{"name":"Odds -
            1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":0},"order":0}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120
            788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/elevators/32771' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"Elevator":{"name":"Odds","description":"Odds
            elevator","elevator_group_id":{"id":6,"name":"New Elevator Group
            2"},"reader_devices":[{"device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)"}}],"control_device_id":{"id":"544140034","name":"BioEntry
            W2 544140034
            (192.168.1.24)","device_type_id":{"id":"13","name":"BioEntry
            W2"}},"floors":[{"name":"Odds -
            1","elevator_device_id":{"device_id":{"id":788930600,"name":"OM-120
            788930600"},"relay_index":0},"order":0}],"module_devices":[{"device_id":{"id":"788930600","name":"OM-120
            788930600"}}],"trigger_actions":[],"active_timeout":"10","dual_authentication":{"device":0,"approval_type":"0","timeout":15,"schedule_id":{"id":"1"},"approval_groups":[]},"tamper_device":{"device_id":{},"switch_type":"0"}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevators/32771"


            payload <- "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/elevators/32771" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Elevator\":{\"name\":\"Odds\",\"description\":\"Odds
            elevator\",\"elevator_group_id\":{\"id\":6,\"name\":\"New Elevator
            Group
            2\"},\"reader_devices\":[{\"device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\"}}],\"control_device_id\":{\"id\":\"544140034\",\"name\":\"BioEntry
            W2 544140034
            (192.168.1.24)\",\"device_type_id\":{\"id\":\"13\",\"name\":\"BioEntry
            W2\"}},\"floors\":[{\"name\":\"Odds -
            1\",\"elevator_device_id\":{\"device_id\":{\"id\":788930600,\"name\":\"OM-120
            788930600\"},\"relay_index\":0},\"order\":0}],\"module_devices\":[{\"device_id\":{\"id\":\"788930600\",\"name\":\"OM-120
            788930600\"}}],\"trigger_actions\":[],\"active_timeout\":\"10\",\"dual_authentication\":{\"device\":0,\"approval_type\":\"0\",\"timeout\":15,\"schedule_id\":{\"id\":\"1\"},\"approval_groups\":[]},\"tamper_device\":{\"device_id\":{},\"switch_type\":\"0\"}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevators/32771")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/elevators/status:
    post:
      tags:
        - Elevators
      summary: View Elevator(s) Status
      operationId: createElevatorStatus
      description: This API is used to view elevator status.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ElevatorCollection:
                  $ref: '#/components/schemas/ElevatorCollection'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/elevators/status \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ElevatorCollection":{"rows":[{"id":32770}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"ElevatorCollection":{"rows":[{"id":32770}]}}' |  \
              http POST https://{baseurl}/api/elevators/status \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ElevatorCollection":{"rows":[{"id":32770}]}}' \
              --output-document \
              - https://{baseurl}/api/elevators/status
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevators/status",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({ElevatorCollection: {rows: [{id:
            32770}]}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/status',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {ElevatorCollection: {rows: [{id: 32770}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/elevators/status");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/status',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {ElevatorCollection: {rows: [{id: 32770}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/elevators/status';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770}]}}'
            };

            fetch('https://{baseurl}/api/elevators/status', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevators/status",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/elevators/status");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/elevators/status", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/elevators/status"


            payload = {"ElevatorCollection": {"rows": [{"id": 32770}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/elevators/status")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevators/status",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/elevators/status');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"ElevatorCollection":{"rows":[{"id":32770}]}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"ElevatorCollection":{"rows":[{"id":32770}]}}');

            $request->setRequestUrl('https://{baseurl}/api/elevators/status');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevators/status")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/elevators/status")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevators/status\"\n\n\tpayload := strings.NewReader(\"{\\\"ElevatorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":32770}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevators/status");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ElevatorCollection": @{ @"rows": @[
            @{ @"id": @32770 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevators/status"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ElevatorCollection": ["rows": [["id": 32770]]]]
            as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevators/status")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/elevators/status");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/elevators/status"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/elevators/status' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/elevators/status' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevators/status"


            payload <- "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/elevators/status" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevators/status")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/elevators/lock:
    post:
      tags:
        - Elevators
      summary: Manual Lock Elevator
      operationId: createElevatorLock
      description: >-
        This API is used to lock elevator access to single/multiple floor
        manually. If you set the state to Manual Lock, the elevator will have
        remained inaccessible even if a user authenticatation succeeded.


        `floors:order` correlates with `order` on `GET /api/elevators/:id` or
        with `floor_id:index` on `POST /api/elevators/status`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ElevatorCollection:
                  $ref: '#/components/schemas/ElevatorCollectionFloor'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/elevators/lock \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            |  \
              http POST https://{baseurl}/api/elevators/lock \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}' \
              --output-document \
              - https://{baseurl}/api/elevators/lock
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevators/lock",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({ElevatorCollection: {rows: [{id: 32770,
            floor: {order: 3}}]}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/lock',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {ElevatorCollection: {rows: [{id: 32770, floor: {order: 3}}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/elevators/lock");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770,
                    "floor": {
                      "order": 3
                    }
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/lock',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {ElevatorCollection: {rows: [{id: 32770, floor: {order: 3}}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/elevators/lock';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            };

            fetch('https://{baseurl}/api/elevators/lock', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevators/lock",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770,
                    "floor": {
                      "order": 3
                    }
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/elevators/lock");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/elevators/lock", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/elevators/lock"


            payload = {"ElevatorCollection": {"rows": [
                        {
                            "id": 32770,
                            "floor": {"order": 3}
                        }
                    ]}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/elevators/lock")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevators/lock",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/elevators/lock');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}');


            $request->setRequestUrl('https://{baseurl}/api/elevators/lock');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevators/lock")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/elevators/lock")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevators/lock\"\n\n\tpayload := strings.NewReader(\"{\\\"ElevatorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":32770,\\\"floor\\\":{\\\"order\\\":3}}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevators/lock");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ElevatorCollection": @{ @"rows": @[
            @{ @"id": @32770, @"floor": @{ @"order": @3 } } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevators/lock"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ElevatorCollection": ["rows": [
                  [
                    "id": 32770,
                    "floor": ["order": 3]
                  ]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevators/lock")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/elevators/lock");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/elevators/lock"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/elevators/lock' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/elevators/lock' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevators/lock"


            payload <-
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/elevators/lock" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevators/lock")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/elevators/unlock:
    post:
      tags:
        - Elevators
      summary: Manual Unlock Elevator
      operationId: createElevatorUnlock
      description: >-
        This API is used to unlock an elevator manually. If you set the state to
        Manual Unlock, the elevator will have remained accessible even if a user
        does not authenticate.


        `floors:order` correlates with `order` on `GET /api/elevators/:id` or
        with `floor_id:index` on `POST /api/elevators/status`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ElevatorCollection:
                  $ref: '#/components/schemas/ElevatorCollectionFloor'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/elevators/unlock \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            |  \
              http POST https://{baseurl}/api/elevators/unlock \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}' \
              --output-document \
              - https://{baseurl}/api/elevators/unlock
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevators/unlock",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({ElevatorCollection: {rows: [{id: 32770,
            floor: {order: 3}}]}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/unlock',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {ElevatorCollection: {rows: [{id: 32770, floor: {order: 3}}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/elevators/unlock");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770,
                    "floor": {
                      "order": 3
                    }
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/unlock',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {ElevatorCollection: {rows: [{id: 32770, floor: {order: 3}}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/elevators/unlock';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            };

            fetch('https://{baseurl}/api/elevators/unlock', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevators/unlock",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770,
                    "floor": {
                      "order": 3
                    }
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/elevators/unlock");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/elevators/unlock", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/elevators/unlock"


            payload = {"ElevatorCollection": {"rows": [
                        {
                            "id": 32770,
                            "floor": {"order": 3}
                        }
                    ]}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/elevators/unlock")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevators/unlock",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/elevators/unlock');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}');


            $request->setRequestUrl('https://{baseurl}/api/elevators/unlock');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevators/unlock")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/elevators/unlock")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevators/unlock\"\n\n\tpayload := strings.NewReader(\"{\\\"ElevatorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":32770,\\\"floor\\\":{\\\"order\\\":3}}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevators/unlock");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ElevatorCollection": @{ @"rows": @[
            @{ @"id": @32770, @"floor": @{ @"order": @3 } } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevators/unlock"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ElevatorCollection": ["rows": [
                  [
                    "id": 32770,
                    "floor": ["order": 3]
                  ]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevators/unlock")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/elevators/unlock");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/elevators/unlock"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/elevators/unlock' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/elevators/unlock' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevators/unlock"


            payload <-
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/elevators/unlock" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevators/unlock")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/elevators/release:
    post:
      tags:
        - Elevators
      summary: Release Elevator Manual Lock/Unlock
      operationId: createElevatorRelease
      description: >-
        This API is used to release the manual lock or manual unlock set by the
        administrator. When running this API, it will also reset the status
        caused by `POST /api/elevators/open`

        `floors:order` correlates with `order` on `GET /api/elevators/:id` or
        with `floor_id:index` on `POST /api/elevators/status`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ElevatorCollection:
                  $ref: '#/components/schemas/ElevatorCollectionFloor'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/elevators/release \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            |  \
              http POST https://{baseurl}/api/elevators/release \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}' \
              --output-document \
              - https://{baseurl}/api/elevators/release
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevators/release",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({ElevatorCollection: {rows: [{id: 32770,
            floor: {order: 3}}]}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/release',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {ElevatorCollection: {rows: [{id: 32770, floor: {order: 3}}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/elevators/release");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770,
                    "floor": {
                      "order": 3
                    }
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/release',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {ElevatorCollection: {rows: [{id: 32770, floor: {order: 3}}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/elevators/release';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            };

            fetch('https://{baseurl}/api/elevators/release', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevators/release",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770,
                    "floor": {
                      "order": 3
                    }
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/elevators/release");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/elevators/release", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/elevators/release"


            payload = {"ElevatorCollection": {"rows": [
                        {
                            "id": 32770,
                            "floor": {"order": 3}
                        }
                    ]}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/elevators/release")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevators/release",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/elevators/release');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}');


            $request->setRequestUrl('https://{baseurl}/api/elevators/release');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevators/release")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/elevators/release")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevators/release\"\n\n\tpayload := strings.NewReader(\"{\\\"ElevatorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":32770,\\\"floor\\\":{\\\"order\\\":3}}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevators/release");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ElevatorCollection": @{ @"rows": @[
            @{ @"id": @32770, @"floor": @{ @"order": @3 } } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevators/release"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ElevatorCollection": ["rows": [
                  [
                    "id": 32770,
                    "floor": ["order": 3]
                  ]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevators/release")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/elevators/release");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/elevators/release"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/elevators/release' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/elevators/release' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevators/release"


            payload <-
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/elevators/release" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevators/release")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/elevators/open:
    post:
      tags:
        - Elevators
      summary: Open Elevator Floor(s)
      operationId: createElevatorOpen
      description: >-
        This API is used to open a floor.


        Will only works if the floor status is clear/default (not manually
        locked/unlocked or there's active alarm)


        `floors:order` correlates with `order` on `GET /api/elevators/:id` or
        with `floor_id:index` on `POST /api/elevators/status`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ElevatorCollection:
                  $ref: '#/components/schemas/ElevatorCollectionFloor'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/elevators/open \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            |  \
              http POST https://{baseurl}/api/elevators/open \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}' \
              --output-document \
              - https://{baseurl}/api/elevators/open
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevators/open",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({ElevatorCollection: {rows: [{id: 32770,
            floor: {order: 3}}]}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/open',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {ElevatorCollection: {rows: [{id: 32770, floor: {order: 3}}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/elevators/open");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770,
                    "floor": {
                      "order": 3
                    }
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/open',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {ElevatorCollection: {rows: [{id: 32770, floor: {order: 3}}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/elevators/open';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
            };

            fetch('https://{baseurl}/api/elevators/open', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevators/open",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770,
                    "floor": {
                      "order": 3
                    }
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/elevators/open");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/elevators/open", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/elevators/open"


            payload = {"ElevatorCollection": {"rows": [
                        {
                            "id": 32770,
                            "floor": {"order": 3}
                        }
                    ]}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/elevators/open")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevators/open",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/elevators/open');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}');


            $request->setRequestUrl('https://{baseurl}/api/elevators/open');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevators/open")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/elevators/open")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevators/open\"\n\n\tpayload := strings.NewReader(\"{\\\"ElevatorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":32770,\\\"floor\\\":{\\\"order\\\":3}}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevators/open");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ElevatorCollection": @{ @"rows": @[
            @{ @"id": @32770, @"floor": @{ @"order": @3 } } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevators/open"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ElevatorCollection": ["rows": [
                  [
                    "id": 32770,
                    "floor": ["order": 3]
                  ]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevators/open")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/elevators/open");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/elevators/open"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/elevators/open' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/elevators/open' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770,"floor":{"order":3}}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevators/open"


            payload <-
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/elevators/open" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770,\"floor\":{\"order\":3}}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevators/open")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/elevators/clear_alarm:
    post:
      tags:
        - Elevators
      summary: Clear Elevator Alarm
      operationId: createElevatorClearAlarm
      description: >-
        This API is used to clear alarms of all doors. If an alarm is  


        set in the Zone, the alarm may be continuously output even if the
        elevator alarm is released.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ElevatorCollection:
                  $ref: '#/components/schemas/ElevatorCollection'
              example:
                ElevatorCollection:
                  rows:
                    - id: 32770
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/elevators/clear_alarm \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ElevatorCollection":{"rows":[{"id":32770}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"ElevatorCollection":{"rows":[{"id":32770}]}}' |  \
              http POST https://{baseurl}/api/elevators/clear_alarm \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ElevatorCollection":{"rows":[{"id":32770}]}}' \
              --output-document \
              - https://{baseurl}/api/elevators/clear_alarm
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/elevators/clear_alarm",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({ElevatorCollection: {rows: [{id:
            32770}]}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/clear_alarm',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {ElevatorCollection: {rows: [{id: 32770}]}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/elevators/clear_alarm");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/elevators/clear_alarm',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {ElevatorCollection: {rows: [{id: 32770}]}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/elevators/clear_alarm';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ElevatorCollection":{"rows":[{"id":32770}]}}'
            };

            fetch('https://{baseurl}/api/elevators/clear_alarm', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/elevators/clear_alarm",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "ElevatorCollection": {
                "rows": [
                  {
                    "id": 32770
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/elevators/clear_alarm");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/elevators/clear_alarm", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/elevators/clear_alarm"


            payload = {"ElevatorCollection": {"rows": [{"id": 32770}]}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/elevators/clear_alarm")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/elevators/clear_alarm",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/elevators/clear_alarm');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"ElevatorCollection":{"rows":[{"id":32770}]}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ElevatorCollection":{"rows":[{"id":32770}]}}');


            $request->setRequestUrl('https://{baseurl}/api/elevators/clear_alarm');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/elevators/clear_alarm")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/elevators/clear_alarm")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/elevators/clear_alarm\"\n\n\tpayload := strings.NewReader(\"{\\\"ElevatorCollection\\\":{\\\"rows\\\":[{\\\"id\\\":32770}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/elevators/clear_alarm");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ElevatorCollection": @{ @"rows": @[
            @{ @"id": @32770 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/elevators/clear_alarm"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ElevatorCollection": ["rows": [["id": 32770]]]]
            as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/elevators/clear_alarm")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/elevators/clear_alarm");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/elevators/clear_alarm"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/elevators/clear_alarm' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/elevators/clear_alarm' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"ElevatorCollection":{"rows":[{"id":32770}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/elevators/clear_alarm"


            payload <- "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/elevators/clear_alarm" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"ElevatorCollection\":{\"rows\":[{\"id\":32770}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/elevators/clear_alarm")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/firmwares/update:
    post:
      tags:
        - Firmware
      summary: Update Firmware
      operationId: createFirmwaresUpdate
      description: >-
        This API is used to update a device's firmware.


        Firmware file need to be placed on `[BioStar X Install Path]\firmware`
        folder.


        Use `/api/device_types` to find `device_type` and `device_type_id`, find
        the device's name and get the id for the parameters value.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                FirmwareFile:
                  type: object
                  properties:
                    filename:
                      type: string
                      description: >-
                        Complete file name (include extension) of the firmware
                        file which will be used to update
                      example: bs3-all_v1.1.1_20230621_sign.bin
                    device_type:
                      type: string
                      description: Type of the device which the firmware file intended to
                      example: '35'
                DeviceCollection:
                  type: object
                  properties:
                    rows:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            description: ID of the device
                            example: '538201713'
                          device_type_id:
                            type: object
                            properties:
                              id:
                                type: string
                                description: Type of the device
                                example: '35'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/firmwares/update \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"FirmwareFile":{"filename":"bs3-all_v1.1.1_20230621_sign.bin","device_type":"35"},"DeviceCollection":{"rows":[{"id":"538201713","device_type_id":{"id":"35"}}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"FirmwareFile":{"filename":"bs3-all_v1.1.1_20230621_sign.bin","device_type":"35"},"DeviceCollection":{"rows":[{"id":"538201713","device_type_id":{"id":"35"}}]}}'
            |  \
              http POST https://{baseurl}/api/firmwares/update \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"FirmwareFile":{"filename":"bs3-all_v1.1.1_20230621_sign.bin","device_type":"35"},"DeviceCollection":{"rows":[{"id":"538201713","device_type_id":{"id":"35"}}]}}' \
              --output-document \
              - https://{baseurl}/api/firmwares/update
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/firmwares/update",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              FirmwareFile: {filename: 'bs3-all_v1.1.1_20230621_sign.bin', device_type: '35'},
              DeviceCollection: {rows: [{id: '538201713', device_type_id: {id: '35'}}]}
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/firmwares/update',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                FirmwareFile: {filename: 'bs3-all_v1.1.1_20230621_sign.bin', device_type: '35'},
                DeviceCollection: {rows: [{id: '538201713', device_type_id: {id: '35'}}]}
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/firmwares/update");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "FirmwareFile": {
                "filename": "bs3-all_v1.1.1_20230621_sign.bin",
                "device_type": "35"
              },
              "DeviceCollection": {
                "rows": [
                  {
                    "id": "538201713",
                    "device_type_id": {
                      "id": "35"
                    }
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/firmwares/update',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                FirmwareFile: {filename: 'bs3-all_v1.1.1_20230621_sign.bin', device_type: '35'},
                DeviceCollection: {rows: [{id: '538201713', device_type_id: {id: '35'}}]}
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/firmwares/update';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"FirmwareFile":{"filename":"bs3-all_v1.1.1_20230621_sign.bin","device_type":"35"},"DeviceCollection":{"rows":[{"id":"538201713","device_type_id":{"id":"35"}}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"FirmwareFile":{"filename":"bs3-all_v1.1.1_20230621_sign.bin","device_type":"35"},"DeviceCollection":{"rows":[{"id":"538201713","device_type_id":{"id":"35"}}]}}'
            };

            fetch('https://{baseurl}/api/firmwares/update', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/firmwares/update",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "FirmwareFile": {
                "filename": "bs3-all_v1.1.1_20230621_sign.bin",
                "device_type": "35"
              },
              "DeviceCollection": {
                "rows": [
                  {
                    "id": "538201713",
                    "device_type_id": {
                      "id": "35"
                    }
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/firmwares/update");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/firmwares/update", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/firmwares/update"


            payload = {
                "FirmwareFile": {
                    "filename": "bs3-all_v1.1.1_20230621_sign.bin",
                    "device_type": "35"
                },
                "DeviceCollection": {"rows": [
                        {
                            "id": "538201713",
                            "device_type_id": {"id": "35"}
                        }
                    ]}
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/firmwares/update")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/firmwares/update",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/firmwares/update');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"FirmwareFile":{"filename":"bs3-all_v1.1.1_20230621_sign.bin","device_type":"35"},"DeviceCollection":{"rows":[{"id":"538201713","device_type_id":{"id":"35"}}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"FirmwareFile":{"filename":"bs3-all_v1.1.1_20230621_sign.bin","device_type":"35"},"DeviceCollection":{"rows":[{"id":"538201713","device_type_id":{"id":"35"}}]}}');


            $request->setRequestUrl('https://{baseurl}/api/firmwares/update');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/firmwares/update")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/firmwares/update")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/firmwares/update\"\n\n\tpayload := strings.NewReader(\"{\\\"FirmwareFile\\\":{\\\"filename\\\":\\\"bs3-all_v1.1.1_20230621_sign.bin\\\",\\\"device_type\\\":\\\"35\\\"},\\\"DeviceCollection\\\":{\\\"rows\\\":[{\\\"id\\\":\\\"538201713\\\",\\\"device_type_id\\\":{\\\"id\\\":\\\"35\\\"}}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/firmwares/update");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"FirmwareFile": @{ @"filename":
            @"bs3-all_v1.1.1_20230621_sign.bin", @"device_type": @"35" },
                                          @"DeviceCollection": @{ @"rows": @[ @{ @"id": @"538201713", @"device_type_id": @{ @"id": @"35" } } ] } };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/firmwares/update"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "FirmwareFile": [
                "filename": "bs3-all_v1.1.1_20230621_sign.bin",
                "device_type": "35"
              ],
              "DeviceCollection": ["rows": [
                  [
                    "id": "538201713",
                    "device_type_id": ["id": "35"]
                  ]
                ]]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/firmwares/update")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/firmwares/update");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/firmwares/update"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/firmwares/update' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"FirmwareFile":{"filename":"bs3-all_v1.1.1_20230621_sign.bin","device_type":"35"},"DeviceCollection":{"rows":[{"id":"538201713","device_type_id":{"id":"35"}}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/firmwares/update' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"FirmwareFile":{"filename":"bs3-all_v1.1.1_20230621_sign.bin","device_type":"35"},"DeviceCollection":{"rows":[{"id":"538201713","device_type_id":{"id":"35"}}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/firmwares/update"


            payload <-
            "{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/firmwares/update" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"FirmwareFile\":{\"filename\":\"bs3-all_v1.1.1_20230621_sign.bin\",\"device_type\":\"35\"},\"DeviceCollection\":{\"rows\":[{\"id\":\"538201713\",\"device_type_id\":{\"id\":\"35\"}}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/firmwares/update")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/firmwares:
    get:
      tags:
        - Firmware
      summary: View Firmwares Information
      operationId: listFirmwares
      description: >-
        This API is used to view firmwares information which is placed on folder
        `[BioStar X Install Path]\firmware`.


        **Response Information Table**


        | **Device Type** | **Value** |

        | --- | --- |

        | BS2_DEVICE_TYPE_UNKNOWN | 0 |

        | BIOENTRY_PLUS | 1 |

        | BIOENTRY_W | 2 |

        | BIOLITE_NET | 3 |

        | XPASS | 4 |

        | XPASS_S2 | 5 |

        | SECURE_IO_2 | 6 |

        | DOOR_MODULE_20 | 7 |

        | BIOSTATION_2 | 8 |

        | BIOSTATION_A2 | 9 |

        | FACESTATION_2 | 10 |

        | IO_DEVICE | 11 |

        | BIOSTATION_L2 | 12 |

        | BIOENTRY_W2 | 13 |

        | CORESTATION_40 | 14 |

        | OUTPUT_MODULE | 15 |

        | INPUT_MODULE | 16 |

        | BIOENTRY_P2 | 17 |

        | BIOLITE_N2 | 18 |

        | XPASS2 | 19 |

        | NOT USED | 20 |

        | BIOENTRY_R2 | 21 |

        | XPASS_D2 | 22 |

        | DOOR_MODULE_21 | 23 |

        | XPASS_D2_KEYPAD | 24 |

        | FACELITE | 25 |

        | XPASS2_KEYPAD | 26 |

        | XPASS_D2_REV | 27 |

        | XPASS_D2_KEYPAD_REV | 28 |

        | FACESTATION_F2_FP | 29 |

        | FACESTATION_F2 | 30 |

        | XSTATION_2_QR | 31 |

        | XSTATION_2 | 32 |

        | IM_120 | 33 |

        | XSTATION_2_FP | 34 |

        | BIOSTATION_3 | 35 |

        | 3RD_OSDP_DEVICE | 36 |

        | 3RD_OSDP_IO_DEVICE | 37 |

        | BIOSTATION_2A | 38 |

        | UZ_OSDP_MODULE | 39 |

        | UZ_OSDP_DOOR_HANDLE | 40 |

        | UZ_OSDP_DOOR_KNOB | 41 |

        | BIOENTRY_W3 | 42 |


        | **Card Model** | **Value** |

        | --- | --- |

        | OMPW | 0 |

        | OIPW | 1 |

        | OEPW | 2 |

        | OHPW | 3 |

        | ODPW | 4 |

        | OAPW | 5 |

        | ODSPW | 6 |

        | PMPW | 20 |

        | PIPW | 21 |

        | PEPW | 22 |

        | PHPW | 23 |

        | PDPW | 24 |

        | PAPW | 25 |

        | PDSPW | 26 |

        | ALL | 30 |


        **Model Code**


        | **Code** | **Position** | **Description** |

        | --- | --- | --- |

        | O | Front | Optical FP Sensor |

        | P | Front | PIV Certified Optical FP Sensor |

        | A | Middle | All Cards |

        | M | Middle | Mifare & DESFire |

        | I | Middle | iClass |

        | E | Middle | EM |

        | H | Middle | HID |

        | D | Middle | Dual Frequency (Mifare/DESFire \[13.56 MHz\], EM \[125
        kHz\]) |

        | DS | Middle | Dual Frequency with SAM Card Slot |

        | P | End | PoE |

        | W | End | WiFi |


        **Note:**


        - PoE and WiFi may differ by device. Please check the devices
        specification from Suprema website
        ([https://www.supremainc.com)](https://www.supremainc.com)
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/firmwares \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/firmwares \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/firmwares
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/firmwares",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/firmwares',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/firmwares");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/firmwares',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/firmwares';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/firmwares', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/firmwares",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/firmwares");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/firmwares", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/firmwares"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/firmwares")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/firmwares",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/firmwares');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/firmwares');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/firmwares")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/firmwares")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/firmwares\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/firmwares");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/firmwares"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/firmwares")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/firmwares");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/firmwares"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/firmwares'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/firmwares'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/firmwares"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/firmwares" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/firmwares")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/floor_levels:
    get:
      tags:
        - Floor Levels
      summary: View Floor Levels
      operationId: listFloorLevel
      description: This API is used to view floor levels recorded on BioStar X.
      parameters:
        - name: limit
          in: query
          schema:
            type: string
          description: >-
            Limit the number of responses by n records. Remove this parameter to
            view all.
        - name: offset
          in: query
          schema:
            type: string
          description: Offset the response shown by n records.
        - name: order_by
          in: query
          schema:
            type: string
          description: Order the response result either ascending or descending
          example: id:false
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/floor_levels',
              qs: {limit: 'SOME_STRING_VALUE', offset: 'SOME_STRING_VALUE', order_by: 'id:false'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/floor_levels");

            req.query({
              "limit": "SOME_STRING_VALUE",
              "offset": "SOME_STRING_VALUE",
              "order_by": "id:false"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/floor_levels',
              params: {limit: 'SOME_STRING_VALUE', offset: 'SOME_STRING_VALUE', order_by: 'id:false'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/floor_levels"


            querystring =
            {"limit":"SOME_STRING_VALUE","offset":"SOME_STRING_VALUE","order_by":"id:false"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/floor_levels');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => 'SOME_STRING_VALUE',
              'offset' => 'SOME_STRING_VALUE',
              'order_by' => 'id:false'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/floor_levels');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'limit' => 'SOME_STRING_VALUE',
              'offset' => 'SOME_STRING_VALUE',
              'order_by' => 'id:false'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/floor_levels"


            queryString <- list(
              limit = "SOME_STRING_VALUE",
              offset = "SOME_STRING_VALUE"
              order_by = "id:false",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/floor_levels?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE&order_by=id%3Afalse")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Floor Levels
      summary: Create Floor Levels
      operationId: createFloorLevel
      description: >-
        This API is used to create floor level.


        You can configure the floor access privileges by using elevators and
        floor information.


        **Known errors:**

        - Duplicate `name`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                FloorLevel:
                  $ref: '#/components/schemas/FloorLevel'
              example:
                FloorLevel:
                  name: aaaax
                  description: aaaa
                  floor_level_items:
                    - elevator_id:
                        id: 32769
                        floors:
                          - id: 5
                            elevator_device_id:
                              device_id:
                                id: 100000115
                              relay_index: 4
                            index: 4
                      schedule_id:
                        id: 1
                    - elevator_id:
                        id: 32769
                        floors:
                          - id: 4
                            elevator_device_id:
                              device_id:
                                id: 100000115
                              relay_index: 3
                            index: 3
                      schedule_id:
                        id: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/floor_levels \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"FloorLevel":{"name":"aaaax","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"FloorLevel":{"name":"aaaax","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
            |  \
              http POST https://{baseurl}/api/floor_levels \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"FloorLevel":{"name":"aaaax","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}' \
              --output-document \
              - https://{baseurl}/api/floor_levels
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/floor_levels",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              FloorLevel: {
                name: 'aaaax',
                description: 'aaaa',
                floor_level_items: [
                  {
                    elevator_id: {
                      id: 32769,
                      floors: [
                        {
                          id: 5,
                          elevator_device_id: {device_id: {id: 100000115}, relay_index: 4},
                          index: 4
                        }
                      ]
                    },
                    schedule_id: {id: 1}
                  },
                  {
                    elevator_id: {
                      id: 32769,
                      floors: [
                        {
                          id: 4,
                          elevator_device_id: {device_id: {id: 100000115}, relay_index: 3},
                          index: 3
                        }
                      ]
                    },
                    schedule_id: {id: 1}
                  }
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/floor_levels',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                FloorLevel: {
                  name: 'aaaax',
                  description: 'aaaa',
                  floor_level_items: [
                    {
                      elevator_id: {
                        id: 32769,
                        floors: [
                          {
                            id: 5,
                            elevator_device_id: {device_id: {id: 100000115}, relay_index: 4},
                            index: 4
                          }
                        ]
                      },
                      schedule_id: {id: 1}
                    },
                    {
                      elevator_id: {
                        id: 32769,
                        floors: [
                          {
                            id: 4,
                            elevator_device_id: {device_id: {id: 100000115}, relay_index: 3},
                            index: 3
                          }
                        ]
                      },
                      schedule_id: {id: 1}
                    }
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/floor_levels");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "FloorLevel": {
                "name": "aaaax",
                "description": "aaaa",
                "floor_level_items": [
                  {
                    "elevator_id": {
                      "id": 32769,
                      "floors": [
                        {
                          "id": 5,
                          "elevator_device_id": {
                            "device_id": {
                              "id": 100000115
                            },
                            "relay_index": 4
                          },
                          "index": 4
                        }
                      ]
                    },
                    "schedule_id": {
                      "id": 1
                    }
                  },
                  {
                    "elevator_id": {
                      "id": 32769,
                      "floors": [
                        {
                          "id": 4,
                          "elevator_device_id": {
                            "device_id": {
                              "id": 100000115
                            },
                            "relay_index": 3
                          },
                          "index": 3
                        }
                      ]
                    },
                    "schedule_id": {
                      "id": 1
                    }
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/floor_levels',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                FloorLevel: {
                  name: 'aaaax',
                  description: 'aaaa',
                  floor_level_items: [
                    {
                      elevator_id: {
                        id: 32769,
                        floors: [
                          {
                            id: 5,
                            elevator_device_id: {device_id: {id: 100000115}, relay_index: 4},
                            index: 4
                          }
                        ]
                      },
                      schedule_id: {id: 1}
                    },
                    {
                      elevator_id: {
                        id: 32769,
                        floors: [
                          {
                            id: 4,
                            elevator_device_id: {device_id: {id: 100000115}, relay_index: 3},
                            index: 3
                          }
                        ]
                      },
                      schedule_id: {id: 1}
                    }
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/floor_levels';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"FloorLevel":{"name":"aaaax","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"FloorLevel":{"name":"aaaax","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
            };

            fetch('https://{baseurl}/api/floor_levels', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/floor_levels",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "FloorLevel": {
                "name": "aaaax",
                "description": "aaaa",
                "floor_level_items": [
                  {
                    "elevator_id": {
                      "id": 32769,
                      "floors": [
                        {
                          "id": 5,
                          "elevator_device_id": {
                            "device_id": {
                              "id": 100000115
                            },
                            "relay_index": 4
                          },
                          "index": 4
                        }
                      ]
                    },
                    "schedule_id": {
                      "id": 1
                    }
                  },
                  {
                    "elevator_id": {
                      "id": 32769,
                      "floors": [
                        {
                          "id": 4,
                          "elevator_device_id": {
                            "device_id": {
                              "id": 100000115
                            },
                            "relay_index": 3
                          },
                          "index": 3
                        }
                      ]
                    },
                    "schedule_id": {
                      "id": 1
                    }
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/floor_levels");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/floor_levels", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/floor_levels"


            payload = {"FloorLevel": {
                    "name": "aaaax",
                    "description": "aaaa",
                    "floor_level_items": [
                        {
                            "elevator_id": {
                                "id": 32769,
                                "floors": [
                                    {
                                        "id": 5,
                                        "elevator_device_id": {
                                            "device_id": {"id": 100000115},
                                            "relay_index": 4
                                        },
                                        "index": 4
                                    }
                                ]
                            },
                            "schedule_id": {"id": 1}
                        },
                        {
                            "elevator_id": {
                                "id": 32769,
                                "floors": [
                                    {
                                        "id": 4,
                                        "elevator_device_id": {
                                            "device_id": {"id": 100000115},
                                            "relay_index": 3
                                        },
                                        "index": 3
                                    }
                                ]
                            },
                            "schedule_id": {"id": 1}
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/floor_levels")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/floor_levels",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/floor_levels');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"FloorLevel":{"name":"aaaax","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"FloorLevel":{"name":"aaaax","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}');


            $request->setRequestUrl('https://{baseurl}/api/floor_levels');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/floor_levels")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/floor_levels")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/floor_levels\"\n\n\tpayload := strings.NewReader(\"{\\\"FloorLevel\\\":{\\\"name\\\":\\\"aaaax\\\",\\\"description\\\":\\\"aaaa\\\",\\\"floor_level_items\\\":[{\\\"elevator_id\\\":{\\\"id\\\":32769,\\\"floors\\\":[{\\\"id\\\":5,\\\"elevator_device_id\\\":{\\\"device_id\\\":{\\\"id\\\":100000115},\\\"relay_index\\\":4},\\\"index\\\":4}]},\\\"schedule_id\\\":{\\\"id\\\":1}},{\\\"elevator_id\\\":{\\\"id\\\":32769,\\\"floors\\\":[{\\\"id\\\":4,\\\"elevator_device_id\\\":{\\\"device_id\\\":{\\\"id\\\":100000115},\\\"relay_index\\\":3},\\\"index\\\":3}]},\\\"schedule_id\\\":{\\\"id\\\":1}}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/floor_levels");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"FloorLevel": @{ @"name": @"aaaax",
            @"description": @"aaaa", @"floor_level_items": @[ @{ @"elevator_id":
            @{ @"id": @32769, @"floors": @[ @{ @"id": @5, @"elevator_device_id":
            @{ @"device_id": @{ @"id": @100000115 }, @"relay_index": @4 },
            @"index": @4 } ] }, @"schedule_id": @{ @"id": @1 } }, @{
            @"elevator_id": @{ @"id": @32769, @"floors": @[ @{ @"id": @4,
            @"elevator_device_id": @{ @"device_id": @{ @"id": @100000115 },
            @"relay_index": @3 }, @"index": @3 } ] }, @"schedule_id": @{ @"id":
            @1 } } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/floor_levels"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["FloorLevel": [
                "name": "aaaax",
                "description": "aaaa",
                "floor_level_items": [
                  [
                    "elevator_id": [
                      "id": 32769,
                      "floors": [
                        [
                          "id": 5,
                          "elevator_device_id": [
                            "device_id": ["id": 100000115],
                            "relay_index": 4
                          ],
                          "index": 4
                        ]
                      ]
                    ],
                    "schedule_id": ["id": 1]
                  ],
                  [
                    "elevator_id": [
                      "id": 32769,
                      "floors": [
                        [
                          "id": 4,
                          "elevator_device_id": [
                            "device_id": ["id": 100000115],
                            "relay_index": 3
                          ],
                          "index": 3
                        ]
                      ]
                    ],
                    "schedule_id": ["id": 1]
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/floor_levels")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/floor_levels");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/floor_levels"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/floor_levels' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"FloorLevel":{"name":"aaaax","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/floor_levels' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"FloorLevel":{"name":"aaaax","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/floor_levels"


            payload <-
            "{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/floor_levels" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"FloorLevel\":{\"name\":\"aaaax\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/floor_levels")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/floor_levels/{id}:
    get:
      tags:
        - Floor Levels
      summary: View a Floor Level Detail
      operationId: viewFloorLevelDetail
      description: This API is used to view the details of a floor level.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the floor level which will be viewed
          example: 32769
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/floor_levels/32769 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/floor_levels/32769 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/floor_levels/32769
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/floor_levels/32769",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/floor_levels/32769',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/floor_levels/32769");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/floor_levels/32769',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/floor_levels/32769';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/floor_levels/32769', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/floor_levels/32769",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/floor_levels/32769");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/floor_levels/32769",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/floor_levels/32769"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/floor_levels/32769")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/floor_levels/32769",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/floor_levels/32769');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/floor_levels/32769');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/floor_levels/32769")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/floor_levels/32769")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/floor_levels/32769\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/floor_levels/32769");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/floor_levels/32769"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/floor_levels/32769")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/floor_levels/32769");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/floor_levels/32769"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/floor_levels/32769' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/floor_levels/32769' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/floor_levels/32769"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/floor_levels/32769"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/floor_levels/32769")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    put:
      tags:
        - Floor Levels
      summary: Update Floor Levels
      operationId: updateFloorLevel
      description: |-
        This API is used to update floor level.
        **Known errors:**
        - Duplicate `name`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                FloorLevel:
                  $ref: '#/components/schemas/FloorLevel'
              example:
                FloorLevel:
                  name: aaaaxxxx
                  description: aaaa
                  floor_level_items:
                    - elevator_id:
                        id: 32769
                        floors:
                          - id: 5
                            elevator_device_id:
                              device_id:
                                id: 100000115
                              relay_index: 4
                            index: 4
                      schedule_id:
                        id: 1
                    - elevator_id:
                        id: 32769
                        floors:
                          - id: 4
                            elevator_device_id:
                              device_id:
                                id: 100000115
                              relay_index: 3
                            index: 3
                      schedule_id:
                        id: 1
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the floor level which will be updated
          example: 32776
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/floor_levels/32776 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"FloorLevel":{"name":"aaaaxxxx","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"FloorLevel":{"name":"aaaaxxxx","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
            |  \
              http PUT https://{baseurl}/api/floor_levels/32776 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"FloorLevel":{"name":"aaaaxxxx","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}' \
              --output-document \
              - https://{baseurl}/api/floor_levels/32776
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/floor_levels/32776",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              FloorLevel: {
                name: 'aaaaxxxx',
                description: 'aaaa',
                floor_level_items: [
                  {
                    elevator_id: {
                      id: 32769,
                      floors: [
                        {
                          id: 5,
                          elevator_device_id: {device_id: {id: 100000115}, relay_index: 4},
                          index: 4
                        }
                      ]
                    },
                    schedule_id: {id: 1}
                  },
                  {
                    elevator_id: {
                      id: 32769,
                      floors: [
                        {
                          id: 4,
                          elevator_device_id: {device_id: {id: 100000115}, relay_index: 3},
                          index: 3
                        }
                      ]
                    },
                    schedule_id: {id: 1}
                  }
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/floor_levels/32776',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                FloorLevel: {
                  name: 'aaaaxxxx',
                  description: 'aaaa',
                  floor_level_items: [
                    {
                      elevator_id: {
                        id: 32769,
                        floors: [
                          {
                            id: 5,
                            elevator_device_id: {device_id: {id: 100000115}, relay_index: 4},
                            index: 4
                          }
                        ]
                      },
                      schedule_id: {id: 1}
                    },
                    {
                      elevator_id: {
                        id: 32769,
                        floors: [
                          {
                            id: 4,
                            elevator_device_id: {device_id: {id: 100000115}, relay_index: 3},
                            index: 3
                          }
                        ]
                      },
                      schedule_id: {id: 1}
                    }
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/floor_levels/32776");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "FloorLevel": {
                "name": "aaaaxxxx",
                "description": "aaaa",
                "floor_level_items": [
                  {
                    "elevator_id": {
                      "id": 32769,
                      "floors": [
                        {
                          "id": 5,
                          "elevator_device_id": {
                            "device_id": {
                              "id": 100000115
                            },
                            "relay_index": 4
                          },
                          "index": 4
                        }
                      ]
                    },
                    "schedule_id": {
                      "id": 1
                    }
                  },
                  {
                    "elevator_id": {
                      "id": 32769,
                      "floors": [
                        {
                          "id": 4,
                          "elevator_device_id": {
                            "device_id": {
                              "id": 100000115
                            },
                            "relay_index": 3
                          },
                          "index": 3
                        }
                      ]
                    },
                    "schedule_id": {
                      "id": 1
                    }
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/floor_levels/32776',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                FloorLevel: {
                  name: 'aaaaxxxx',
                  description: 'aaaa',
                  floor_level_items: [
                    {
                      elevator_id: {
                        id: 32769,
                        floors: [
                          {
                            id: 5,
                            elevator_device_id: {device_id: {id: 100000115}, relay_index: 4},
                            index: 4
                          }
                        ]
                      },
                      schedule_id: {id: 1}
                    },
                    {
                      elevator_id: {
                        id: 32769,
                        floors: [
                          {
                            id: 4,
                            elevator_device_id: {device_id: {id: 100000115}, relay_index: 3},
                            index: 3
                          }
                        ]
                      },
                      schedule_id: {id: 1}
                    }
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/floor_levels/32776';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"FloorLevel":{"name":"aaaaxxxx","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"FloorLevel":{"name":"aaaaxxxx","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
            };

            fetch('https://{baseurl}/api/floor_levels/32776', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/floor_levels/32776",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "FloorLevel": {
                "name": "aaaaxxxx",
                "description": "aaaa",
                "floor_level_items": [
                  {
                    "elevator_id": {
                      "id": 32769,
                      "floors": [
                        {
                          "id": 5,
                          "elevator_device_id": {
                            "device_id": {
                              "id": 100000115
                            },
                            "relay_index": 4
                          },
                          "index": 4
                        }
                      ]
                    },
                    "schedule_id": {
                      "id": 1
                    }
                  },
                  {
                    "elevator_id": {
                      "id": 32769,
                      "floors": [
                        {
                          "id": 4,
                          "elevator_device_id": {
                            "device_id": {
                              "id": 100000115
                            },
                            "relay_index": 3
                          },
                          "index": 3
                        }
                      ]
                    },
                    "schedule_id": {
                      "id": 1
                    }
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/floor_levels/32776");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/floor_levels/32776", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/floor_levels/32776"


            payload = {"FloorLevel": {
                    "name": "aaaaxxxx",
                    "description": "aaaa",
                    "floor_level_items": [
                        {
                            "elevator_id": {
                                "id": 32769,
                                "floors": [
                                    {
                                        "id": 5,
                                        "elevator_device_id": {
                                            "device_id": {"id": 100000115},
                                            "relay_index": 4
                                        },
                                        "index": 4
                                    }
                                ]
                            },
                            "schedule_id": {"id": 1}
                        },
                        {
                            "elevator_id": {
                                "id": 32769,
                                "floors": [
                                    {
                                        "id": 4,
                                        "elevator_device_id": {
                                            "device_id": {"id": 100000115},
                                            "relay_index": 3
                                        },
                                        "index": 3
                                    }
                                ]
                            },
                            "schedule_id": {"id": 1}
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/floor_levels/32776")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/floor_levels/32776",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/floor_levels/32776');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"FloorLevel":{"name":"aaaaxxxx","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"FloorLevel":{"name":"aaaaxxxx","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}');


            $request->setRequestUrl('https://{baseurl}/api/floor_levels/32776');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/floor_levels/32776")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/floor_levels/32776")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/floor_levels/32776\"\n\n\tpayload := strings.NewReader(\"{\\\"FloorLevel\\\":{\\\"name\\\":\\\"aaaaxxxx\\\",\\\"description\\\":\\\"aaaa\\\",\\\"floor_level_items\\\":[{\\\"elevator_id\\\":{\\\"id\\\":32769,\\\"floors\\\":[{\\\"id\\\":5,\\\"elevator_device_id\\\":{\\\"device_id\\\":{\\\"id\\\":100000115},\\\"relay_index\\\":4},\\\"index\\\":4}]},\\\"schedule_id\\\":{\\\"id\\\":1}},{\\\"elevator_id\\\":{\\\"id\\\":32769,\\\"floors\\\":[{\\\"id\\\":4,\\\"elevator_device_id\\\":{\\\"device_id\\\":{\\\"id\\\":100000115},\\\"relay_index\\\":3},\\\"index\\\":3}]},\\\"schedule_id\\\":{\\\"id\\\":1}}]}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/floor_levels/32776");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"FloorLevel": @{ @"name":
            @"aaaaxxxx", @"description": @"aaaa", @"floor_level_items": @[ @{
            @"elevator_id": @{ @"id": @32769, @"floors": @[ @{ @"id": @5,
            @"elevator_device_id": @{ @"device_id": @{ @"id": @100000115 },
            @"relay_index": @4 }, @"index": @4 } ] }, @"schedule_id": @{ @"id":
            @1 } }, @{ @"elevator_id": @{ @"id": @32769, @"floors": @[ @{ @"id":
            @4, @"elevator_device_id": @{ @"device_id": @{ @"id": @100000115 },
            @"relay_index": @3 }, @"index": @3 } ] }, @"schedule_id": @{ @"id":
            @1 } } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/floor_levels/32776"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["FloorLevel": [
                "name": "aaaaxxxx",
                "description": "aaaa",
                "floor_level_items": [
                  [
                    "elevator_id": [
                      "id": 32769,
                      "floors": [
                        [
                          "id": 5,
                          "elevator_device_id": [
                            "device_id": ["id": 100000115],
                            "relay_index": 4
                          ],
                          "index": 4
                        ]
                      ]
                    ],
                    "schedule_id": ["id": 1]
                  ],
                  [
                    "elevator_id": [
                      "id": 32769,
                      "floors": [
                        [
                          "id": 4,
                          "elevator_device_id": [
                            "device_id": ["id": 100000115],
                            "relay_index": 3
                          ],
                          "index": 3
                        ]
                      ]
                    ],
                    "schedule_id": ["id": 1]
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/floor_levels/32776")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/floor_levels/32776");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/floor_levels/32776"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/floor_levels/32776' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"FloorLevel":{"name":"aaaaxxxx","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/floor_levels/32776' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"FloorLevel":{"name":"aaaaxxxx","description":"aaaa","floor_level_items":[{"elevator_id":{"id":32769,"floors":[{"id":5,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":4},"index":4}]},"schedule_id":{"id":1}},{"elevator_id":{"id":32769,"floors":[{"id":4,"elevator_device_id":{"device_id":{"id":100000115},"relay_index":3},"index":3}]},"schedule_id":{"id":1}}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/floor_levels/32776"


            payload <-
            "{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/floor_levels/32776"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"FloorLevel\":{\"name\":\"aaaaxxxx\",\"description\":\"aaaa\",\"floor_level_items\":[{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":5,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":4},\"index\":4}]},\"schedule_id\":{\"id\":1}},{\"elevator_id\":{\"id\":32769,\"floors\":[{\"id\":4,\"elevator_device_id\":{\"device_id\":{\"id\":100000115},\"relay_index\":3},\"index\":3}]},\"schedule_id\":{\"id\":1}}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/floor_levels/32776")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Floor Levels
      summary: Delete Floor Level
      operationId: deleteFloorLevel
      description: This API is used to delete floor levels.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the floor level which will be deleted
          example: 32775
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url https://{baseurl}/api/floor_levels/32775 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE https://{baseurl}/api/floor_levels/32775 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/floor_levels/32775
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/floor_levels/32775",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/floor_levels/32775',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/floor_levels/32775");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/floor_levels/32775',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/floor_levels/32775';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/floor_levels/32775', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/floor_levels/32775",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/floor_levels/32775");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/floor_levels/32775",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/floor_levels/32775"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("DELETE", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/floor_levels/32775")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/floor_levels/32775",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/floor_levels/32775');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/floor_levels/32775');
            $request->setRequestMethod('DELETE');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/floor_levels/32775")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/floor_levels/32775")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/floor_levels/32775\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/floor_levels/32775");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/floor_levels/32775"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/floor_levels/32775")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/floor_levels/32775");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/floor_levels/32775"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/floor_levels/32775' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/floor_levels/32775' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/floor_levels/32775"


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/floor_levels/32775"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/floor_levels/32775")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/schedules:
    get:
      tags:
        - Schedules
      summary: View Schedules
      operationId: listSchedules
      description: This API is used to view all schedules recorded on BioStar X.
      parameters:
        - name: limit
          in: query
          schema:
            type: string
          description: >-
            Limit the number of responses by n records. Remove this parameter to
            view all.
        - name: offset
          in: query
          schema:
            type: string
          description: Offset the response shown by n records.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/schedules',
              qs: {limit: 'SOME_STRING_VALUE', offset: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/schedules");

            req.query({
              "limit": "SOME_STRING_VALUE",
              "offset": "SOME_STRING_VALUE"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/schedules',
              params: {limit: 'SOME_STRING_VALUE', offset: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/schedules"


            querystring =
            {"limit":"SOME_STRING_VALUE","offset":"SOME_STRING_VALUE"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/schedules');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => 'SOME_STRING_VALUE',
              'offset' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/schedules');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'limit' => 'SOME_STRING_VALUE',
              'offset' => 'SOME_STRING_VALUE'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/schedules"


            queryString <- list(
              limit = "SOME_STRING_VALUE"
              offset = "SOME_STRING_VALUE",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/schedules?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Schedules
      summary: Create Schedule (Daily)
      operationId: createSchedules
      description: This API example shows how to create daily schedule.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Schedule:
                  $ref: '#/components/schemas/Schedule'
              example:
                Schedule:
                  name: Daily
                  description: DDD
                  daily_schedules:
                    - day_index: 0
                      time_segments:
                        - start_time: 0
                          end_time: 1380
                    - day_index: 1
                      time_segments:
                        - start_time: 1260
                          end_time: 1320
                  holiday_schedules: []
                  days_of_iteration: 2
                  start_date: '2022-04-26T00:00:00.00Z'
                  use_daily_iteration: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/schedules \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
            |  \
              http POST https://{baseurl}/api/schedules \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}' \
              --output-document \
              - https://{baseurl}/api/schedules
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/schedules",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Schedule: {
                name: 'Daily',
                description: 'DDD',
                daily_schedules: [
                  {day_index: 0, time_segments: [{start_time: 0, end_time: 1380}]},
                  {day_index: 1, time_segments: [{start_time: 1260, end_time: 1320}]}
                ],
                holiday_schedules: [],
                days_of_iteration: 2,
                start_date: '2022-04-26T00:00:00.00Z',
                use_daily_iteration: true
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/schedules',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Schedule: {
                  name: 'Daily',
                  description: 'DDD',
                  daily_schedules: [
                    {day_index: 0, time_segments: [{start_time: 0, end_time: 1380}]},
                    {day_index: 1, time_segments: [{start_time: 1260, end_time: 1320}]}
                  ],
                  holiday_schedules: [],
                  days_of_iteration: 2,
                  start_date: '2022-04-26T00:00:00.00Z',
                  use_daily_iteration: true
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/schedules");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Schedule": {
                "name": "Daily",
                "description": "DDD",
                "daily_schedules": [
                  {
                    "day_index": 0,
                    "time_segments": [
                      {
                        "start_time": 0,
                        "end_time": 1380
                      }
                    ]
                  },
                  {
                    "day_index": 1,
                    "time_segments": [
                      {
                        "start_time": 1260,
                        "end_time": 1320
                      }
                    ]
                  }
                ],
                "holiday_schedules": [],
                "days_of_iteration": 2,
                "start_date": "2022-04-26T00:00:00.00Z",
                "use_daily_iteration": true
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/schedules',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Schedule: {
                  name: 'Daily',
                  description: 'DDD',
                  daily_schedules: [
                    {day_index: 0, time_segments: [{start_time: 0, end_time: 1380}]},
                    {day_index: 1, time_segments: [{start_time: 1260, end_time: 1320}]}
                  ],
                  holiday_schedules: [],
                  days_of_iteration: 2,
                  start_date: '2022-04-26T00:00:00.00Z',
                  use_daily_iteration: true
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/schedules';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
            };

            fetch('https://{baseurl}/api/schedules', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/schedules",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Schedule": {
                "name": "Daily",
                "description": "DDD",
                "daily_schedules": [
                  {
                    "day_index": 0,
                    "time_segments": [
                      {
                        "start_time": 0,
                        "end_time": 1380
                      }
                    ]
                  },
                  {
                    "day_index": 1,
                    "time_segments": [
                      {
                        "start_time": 1260,
                        "end_time": 1320
                      }
                    ]
                  }
                ],
                "holiday_schedules": [],
                "days_of_iteration": 2,
                "start_date": "2022-04-26T00:00:00.00Z",
                "use_daily_iteration": true
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/schedules");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/schedules", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/schedules"


            payload = {"Schedule": {
                    "name": "Daily",
                    "description": "DDD",
                    "daily_schedules": [
                        {
                            "day_index": 0,
                            "time_segments": [
                                {
                                    "start_time": 0,
                                    "end_time": 1380
                                }
                            ]
                        },
                        {
                            "day_index": 1,
                            "time_segments": [
                                {
                                    "start_time": 1260,
                                    "end_time": 1320
                                }
                            ]
                        }
                    ],
                    "holiday_schedules": [],
                    "days_of_iteration": 2,
                    "start_date": "2022-04-26T00:00:00.00Z",
                    "use_daily_iteration": True
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/schedules")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/schedules",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/schedules');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}');


            $request->setRequestUrl('https://{baseurl}/api/schedules');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/schedules")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/schedules")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/schedules\"\n\n\tpayload := strings.NewReader(\"{\\\"Schedule\\\":{\\\"name\\\":\\\"Daily\\\",\\\"description\\\":\\\"DDD\\\",\\\"daily_schedules\\\":[{\\\"day_index\\\":0,\\\"time_segments\\\":[{\\\"start_time\\\":0,\\\"end_time\\\":1380}]},{\\\"day_index\\\":1,\\\"time_segments\\\":[{\\\"start_time\\\":1260,\\\"end_time\\\":1320}]}],\\\"holiday_schedules\\\":[],\\\"days_of_iteration\\\":2,\\\"start_date\\\":\\\"2022-04-26T00:00:00.00Z\\\",\\\"use_daily_iteration\\\":true}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/schedules");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Schedule": @{ @"name": @"Daily",
            @"description": @"DDD", @"daily_schedules": @[ @{ @"day_index": @0,
            @"time_segments": @[ @{ @"start_time": @0, @"end_time": @1380 } ] },
            @{ @"day_index": @1, @"time_segments": @[ @{ @"start_time": @1260,
            @"end_time": @1320 } ] } ], @"holiday_schedules": @[  ],
            @"days_of_iteration": @2, @"start_date": @"2022-04-26T00:00:00.00Z",
            @"use_daily_iteration": @YES } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/schedules"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Schedule": [
                "name": "Daily",
                "description": "DDD",
                "daily_schedules": [
                  [
                    "day_index": 0,
                    "time_segments": [
                      [
                        "start_time": 0,
                        "end_time": 1380
                      ]
                    ]
                  ],
                  [
                    "day_index": 1,
                    "time_segments": [
                      [
                        "start_time": 1260,
                        "end_time": 1320
                      ]
                    ]
                  ]
                ],
                "holiday_schedules": [],
                "days_of_iteration": 2,
                "start_date": "2022-04-26T00:00:00.00Z",
                "use_daily_iteration": true
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/schedules")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/schedules");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/schedules"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/schedules'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/schedules'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/schedules"


            payload <-
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/schedules" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/schedules")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/schedules/{id}:
    get:
      tags:
        - Schedules
      summary: View a Schedule Detail
      operationId: viewScheduleDetail
      description: This API is used to view a schedule detail recorded on BioStar X.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the schedule which will be viewed
          example: 2
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/schedules/2 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/schedules/2 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/schedules/2
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/schedules/2",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/schedules/2',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/schedules/2");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/schedules/2',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/schedules/2';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/schedules/2', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/schedules/2",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/schedules/2");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/schedules/2", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/schedules/2"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/schedules/2")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/schedules/2",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/schedules/2');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/schedules/2');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/schedules/2")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/schedules/2")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/schedules/2\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/schedules/2");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/schedules/2"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/schedules/2")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/schedules/2");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/schedules/2"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/schedules/2' -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/schedules/2' -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/schedules/2"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/schedules/2" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/schedules/2")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Schedules
      summary: Delete Schedules
      operationId: deleteSchedules
      description: This API is used to delete schedules recorded on BioStar X.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the schedule which will be deleted
          example: 5
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url https://{baseurl}/api/schedules/5 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE https://{baseurl}/api/schedules/5 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/schedules/5
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/schedules/5",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/schedules/5',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("DELETE", "https://{baseurl}/api/schedules/5");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/schedules/5',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/schedules/5';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/schedules/5', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/schedules/5",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/schedules/5");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("DELETE", "{baseurl}/api/schedules/5", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/schedules/5"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("DELETE", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/schedules/5")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/schedules/5",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/schedules/5');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/schedules/5');
            $request->setRequestMethod('DELETE');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/schedules/5")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/schedules/5")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/schedules/5\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/schedules/5");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/schedules/5"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/schedules/5")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/schedules/5");
            var request = new RestRequest(Method.DELETE);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/schedules/5"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/schedules/5' -Method DELETE -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/schedules/5' -Method DELETE -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/schedules/5"


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/schedules/5" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/schedules/5")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    put:
      tags:
        - Schedules
      summary: Update a Schedule
      operationId: updateSchedules
      description: This API is used to update a schedule.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Schedule:
                  $ref: '#/components/schemas/Schedule'
              example:
                Schedule:
                  name: Daily
                  description: DDD
                  daily_schedules:
                    - day_index: 0
                      time_segments:
                        - start_time: 0
                          end_time: 1380
                    - day_index: 1
                      time_segments:
                        - start_time: 1260
                          end_time: 1320
                  holiday_schedules: []
                  days_of_iteration: 2
                  start_date: '2022-04-26T00:00:00.00Z'
                  use_daily_iteration: true
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the schedule which will be updated
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/schedules/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
            |  \
              http PUT https://{baseurl}/api/schedules/{id} \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}' \
              --output-document \
              - https://{baseurl}/api/schedules/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/schedules/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Schedule: {
                name: 'Daily',
                description: 'DDD',
                daily_schedules: [
                  {day_index: 0, time_segments: [{start_time: 0, end_time: 1380}]},
                  {day_index: 1, time_segments: [{start_time: 1260, end_time: 1320}]}
                ],
                holiday_schedules: [],
                days_of_iteration: 2,
                start_date: '2022-04-26T00:00:00.00Z',
                use_daily_iteration: true
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/schedules/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Schedule: {
                  name: 'Daily',
                  description: 'DDD',
                  daily_schedules: [
                    {day_index: 0, time_segments: [{start_time: 0, end_time: 1380}]},
                    {day_index: 1, time_segments: [{start_time: 1260, end_time: 1320}]}
                  ],
                  holiday_schedules: [],
                  days_of_iteration: 2,
                  start_date: '2022-04-26T00:00:00.00Z',
                  use_daily_iteration: true
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/schedules/{id}");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Schedule": {
                "name": "Daily",
                "description": "DDD",
                "daily_schedules": [
                  {
                    "day_index": 0,
                    "time_segments": [
                      {
                        "start_time": 0,
                        "end_time": 1380
                      }
                    ]
                  },
                  {
                    "day_index": 1,
                    "time_segments": [
                      {
                        "start_time": 1260,
                        "end_time": 1320
                      }
                    ]
                  }
                ],
                "holiday_schedules": [],
                "days_of_iteration": 2,
                "start_date": "2022-04-26T00:00:00.00Z",
                "use_daily_iteration": true
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/schedules/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Schedule: {
                  name: 'Daily',
                  description: 'DDD',
                  daily_schedules: [
                    {day_index: 0, time_segments: [{start_time: 0, end_time: 1380}]},
                    {day_index: 1, time_segments: [{start_time: 1260, end_time: 1320}]}
                  ],
                  holiday_schedules: [],
                  days_of_iteration: 2,
                  start_date: '2022-04-26T00:00:00.00Z',
                  use_daily_iteration: true
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/schedules/{id}';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
            };

            fetch('https://{baseurl}/api/schedules/{id}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/schedules/{id}",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Schedule": {
                "name": "Daily",
                "description": "DDD",
                "daily_schedules": [
                  {
                    "day_index": 0,
                    "time_segments": [
                      {
                        "start_time": 0,
                        "end_time": 1380
                      }
                    ]
                  },
                  {
                    "day_index": 1,
                    "time_segments": [
                      {
                        "start_time": 1260,
                        "end_time": 1320
                      }
                    ]
                  }
                ],
                "holiday_schedules": [],
                "days_of_iteration": 2,
                "start_date": "2022-04-26T00:00:00.00Z",
                "use_daily_iteration": true
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/schedules/{id}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/schedules/{id}", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/schedules/{id}"


            payload = {"Schedule": {
                    "name": "Daily",
                    "description": "DDD",
                    "daily_schedules": [
                        {
                            "day_index": 0,
                            "time_segments": [
                                {
                                    "start_time": 0,
                                    "end_time": 1380
                                }
                            ]
                        },
                        {
                            "day_index": 1,
                            "time_segments": [
                                {
                                    "start_time": 1260,
                                    "end_time": 1320
                                }
                            ]
                        }
                    ],
                    "holiday_schedules": [],
                    "days_of_iteration": 2,
                    "start_date": "2022-04-26T00:00:00.00Z",
                    "use_daily_iteration": True
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/schedules/{id}")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/schedules/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/schedules/{id}');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}');


            $request->setRequestUrl('https://{baseurl}/api/schedules/{id}');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/schedules/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/schedules/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/schedules/{id}\"\n\n\tpayload := strings.NewReader(\"{\\\"Schedule\\\":{\\\"name\\\":\\\"Daily\\\",\\\"description\\\":\\\"DDD\\\",\\\"daily_schedules\\\":[{\\\"day_index\\\":0,\\\"time_segments\\\":[{\\\"start_time\\\":0,\\\"end_time\\\":1380}]},{\\\"day_index\\\":1,\\\"time_segments\\\":[{\\\"start_time\\\":1260,\\\"end_time\\\":1320}]}],\\\"holiday_schedules\\\":[],\\\"days_of_iteration\\\":2,\\\"start_date\\\":\\\"2022-04-26T00:00:00.00Z\\\",\\\"use_daily_iteration\\\":true}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/schedules/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Schedule": @{ @"name": @"Daily",
            @"description": @"DDD", @"daily_schedules": @[ @{ @"day_index": @0,
            @"time_segments": @[ @{ @"start_time": @0, @"end_time": @1380 } ] },
            @{ @"day_index": @1, @"time_segments": @[ @{ @"start_time": @1260,
            @"end_time": @1320 } ] } ], @"holiday_schedules": @[  ],
            @"days_of_iteration": @2, @"start_date": @"2022-04-26T00:00:00.00Z",
            @"use_daily_iteration": @YES } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/schedules/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Schedule": [
                "name": "Daily",
                "description": "DDD",
                "daily_schedules": [
                  [
                    "day_index": 0,
                    "time_segments": [
                      [
                        "start_time": 0,
                        "end_time": 1380
                      ]
                    ]
                  ],
                  [
                    "day_index": 1,
                    "time_segments": [
                      [
                        "start_time": 1260,
                        "end_time": 1320
                      ]
                    ]
                  ]
                ],
                "holiday_schedules": [],
                "days_of_iteration": 2,
                "start_date": "2022-04-26T00:00:00.00Z",
                "use_daily_iteration": true
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/schedules/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/schedules/{id}");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/schedules/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/schedules/{id}' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/schedules/{id}' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"Schedule":{"name":"Daily","description":"DDD","daily_schedules":[{"day_index":0,"time_segments":[{"start_time":0,"end_time":1380}]},{"day_index":1,"time_segments":[{"start_time":1260,"end_time":1320}]}],"holiday_schedules":[],"days_of_iteration":2,"start_date":"2022-04-26T00:00:00.00Z","use_daily_iteration":true}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/schedules/{id}"


            payload <-
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/schedules/{id}" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Schedule\":{\"name\":\"Daily\",\"description\":\"DDD\",\"daily_schedules\":[{\"day_index\":0,\"time_segments\":[{\"start_time\":0,\"end_time\":1380}]},{\"day_index\":1,\"time_segments\":[{\"start_time\":1260,\"end_time\":1320}]}],\"holiday_schedules\":[],\"days_of_iteration\":2,\"start_date\":\"2022-04-26T00:00:00.00Z\",\"use_daily_iteration\":true}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/schedules/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/holiday_groups:
    get:
      tags:
        - Holiday Groups
      summary: View Holiday Groups
      operationId: listHolidayGroup
      description: This API is used to view all holiday groups recorded on BioStar X.
      parameters:
        - name: limit
          in: query
          schema:
            type: string
          description: >-
            Limit the number of responses by n records. Remove this parameter to
            view all.
        - name: offset
          in: query
          schema:
            type: string
          description: Offset the response shown by n records.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/holiday_groups',
              qs: {limit: 'SOME_STRING_VALUE', offset: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/holiday_groups");

            req.query({
              "limit": "SOME_STRING_VALUE",
              "offset": "SOME_STRING_VALUE"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/holiday_groups',
              params: {limit: 'SOME_STRING_VALUE', offset: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/holiday_groups"


            querystring =
            {"limit":"SOME_STRING_VALUE","offset":"SOME_STRING_VALUE"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/holiday_groups');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => 'SOME_STRING_VALUE',
              'offset' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/holiday_groups');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'limit' => 'SOME_STRING_VALUE',
              'offset' => 'SOME_STRING_VALUE'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/holiday_groups"


            queryString <- list(
              limit = "SOME_STRING_VALUE"
              offset = "SOME_STRING_VALUE",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/holiday_groups?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Holiday Groups
      summary: Create Holiday Group
      operationId: createHolidayGroup
      description: This API is used to create holiday groups on BioStar X.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                HolidayGroup:
                  $ref: '#/components/schemas/HolidayGroup'
              example:
                HolidayGroup:
                  name: Idul Fitri 2022
                  description: Idul Fitri for year 2022
                  holidays:
                    - repeat_interval: 0
                      start_date: '2022-05-02T00:00:00.00Z'
                    - repeat_interval: 0
                      start_date: '2022-05-03T00:00:00.00Z'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/holiday_groups \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri for year 2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul
            Fitri for year
            2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
            |  \
              http POST https://{baseurl}/api/holiday_groups \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri for year 2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}' \
              --output-document \
              - https://{baseurl}/api/holiday_groups
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/holiday_groups",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              HolidayGroup: {
                name: 'Idul Fitri 2022',
                description: 'Idul Fitri for year 2022',
                holidays: [
                  {repeat_interval: 0, start_date: '2022-05-02T00:00:00.00Z'},
                  {repeat_interval: 0, start_date: '2022-05-03T00:00:00.00Z'}
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/holiday_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                HolidayGroup: {
                  name: 'Idul Fitri 2022',
                  description: 'Idul Fitri for year 2022',
                  holidays: [
                    {repeat_interval: 0, start_date: '2022-05-02T00:00:00.00Z'},
                    {repeat_interval: 0, start_date: '2022-05-03T00:00:00.00Z'}
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/holiday_groups");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "HolidayGroup": {
                "name": "Idul Fitri 2022",
                "description": "Idul Fitri for year 2022",
                "holidays": [
                  {
                    "repeat_interval": 0,
                    "start_date": "2022-05-02T00:00:00.00Z"
                  },
                  {
                    "repeat_interval": 0,
                    "start_date": "2022-05-03T00:00:00.00Z"
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/holiday_groups',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                HolidayGroup: {
                  name: 'Idul Fitri 2022',
                  description: 'Idul Fitri for year 2022',
                  holidays: [
                    {repeat_interval: 0, start_date: '2022-05-02T00:00:00.00Z'},
                    {repeat_interval: 0, start_date: '2022-05-03T00:00:00.00Z'}
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/holiday_groups';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri for year 2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri for year 2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
            };

            fetch('https://{baseurl}/api/holiday_groups', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/holiday_groups",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"HolidayGroup\":{\"name\":\"Idul Fitri 2022\",\"description\":\"Idul Fitri for year 2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "HolidayGroup": {
                "name": "Idul Fitri 2022",
                "description": "Idul Fitri for year 2022",
                "holidays": [
                  {
                    "repeat_interval": 0,
                    "start_date": "2022-05-02T00:00:00.00Z"
                  },
                  {
                    "repeat_interval": 0,
                    "start_date": "2022-05-03T00:00:00.00Z"
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/holiday_groups");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/holiday_groups", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/holiday_groups"


            payload = {"HolidayGroup": {
                    "name": "Idul Fitri 2022",
                    "description": "Idul Fitri for year 2022",
                    "holidays": [
                        {
                            "repeat_interval": 0,
                            "start_date": "2022-05-02T00:00:00.00Z"
                        },
                        {
                            "repeat_interval": 0,
                            "start_date": "2022-05-03T00:00:00.00Z"
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/holiday_groups")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/holiday_groups",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"HolidayGroup\":{\"name\":\"Idul Fitri 2022\",\"description\":\"Idul Fitri for year 2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/holiday_groups');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"HolidayGroup":{"name":"Idul Fitri
            2022","description":"Idul Fitri for year
            2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"HolidayGroup":{"name":"Idul Fitri
            2022","description":"Idul Fitri for year
            2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}');


            $request->setRequestUrl('https://{baseurl}/api/holiday_groups');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/holiday_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/holiday_groups")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"HolidayGroup\":{\"name\":\"Idul Fitri 2022\",\"description\":\"Idul Fitri for year 2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/holiday_groups\"\n\n\tpayload := strings.NewReader(\"{\\\"HolidayGroup\\\":{\\\"name\\\":\\\"Idul Fitri 2022\\\",\\\"description\\\":\\\"Idul Fitri for year 2022\\\",\\\"holidays\\\":[{\\\"repeat_interval\\\":0,\\\"start_date\\\":\\\"2022-05-02T00:00:00.00Z\\\"},{\\\"repeat_interval\\\":0,\\\"start_date\\\":\\\"2022-05-03T00:00:00.00Z\\\"}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/holiday_groups");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"HolidayGroup": @{ @"name": @"Idul
            Fitri 2022", @"description": @"Idul Fitri for year 2022",
            @"holidays": @[ @{ @"repeat_interval": @0, @"start_date":
            @"2022-05-02T00:00:00.00Z" }, @{ @"repeat_interval": @0,
            @"start_date": @"2022-05-03T00:00:00.00Z" } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/holiday_groups"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["HolidayGroup": [
                "name": "Idul Fitri 2022",
                "description": "Idul Fitri for year 2022",
                "holidays": [
                  [
                    "repeat_interval": 0,
                    "start_date": "2022-05-02T00:00:00.00Z"
                  ],
                  [
                    "repeat_interval": 0,
                    "start_date": "2022-05-03T00:00:00.00Z"
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/holiday_groups")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/holiday_groups");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/holiday_groups"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"HolidayGroup\":{\"name\":\"Idul Fitri 2022\",\"description\":\"Idul Fitri for year 2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/holiday_groups' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri
            for year
            2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/holiday_groups' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri
            for year
            2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/holiday_groups"


            payload <- "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/holiday_groups" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/holiday_groups")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/holiday_groups/{id}:
    put:
      tags:
        - Holiday Groups
      summary: Update Holiday Group
      operationId: updateHolidayGroup
      description: This API is used to update holiday groups on BioStar X.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                HolidayGroup:
                  $ref: '#/components/schemas/HolidayGroup'
              example:
                HolidayGroup:
                  name: Idul Fitri 2022
                  description: Idul Fitri for year 2022
                  holidays:
                    - repeat_interval: 0
                      start_date: '2022-05-02T00:00:00.00Z'
                    - repeat_interval: 0
                      start_date: '2022-05-03T00:00:00.00Z'
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the holiday group which will be updated.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/holiday_groups/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri for year 2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul
            Fitri for year
            2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
            |  \
              http PUT https://{baseurl}/api/holiday_groups/{id} \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri for year 2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}' \
              --output-document \
              - https://{baseurl}/api/holiday_groups/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/holiday_groups/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              HolidayGroup: {
                name: 'Idul Fitri 2022',
                description: 'Idul Fitri for year 2022',
                holidays: [
                  {repeat_interval: 0, start_date: '2022-05-02T00:00:00.00Z'},
                  {repeat_interval: 0, start_date: '2022-05-03T00:00:00.00Z'}
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/holiday_groups/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                HolidayGroup: {
                  name: 'Idul Fitri 2022',
                  description: 'Idul Fitri for year 2022',
                  holidays: [
                    {repeat_interval: 0, start_date: '2022-05-02T00:00:00.00Z'},
                    {repeat_interval: 0, start_date: '2022-05-03T00:00:00.00Z'}
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/holiday_groups/{id}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "HolidayGroup": {
                "name": "Idul Fitri 2022",
                "description": "Idul Fitri for year 2022",
                "holidays": [
                  {
                    "repeat_interval": 0,
                    "start_date": "2022-05-02T00:00:00.00Z"
                  },
                  {
                    "repeat_interval": 0,
                    "start_date": "2022-05-03T00:00:00.00Z"
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/holiday_groups/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                HolidayGroup: {
                  name: 'Idul Fitri 2022',
                  description: 'Idul Fitri for year 2022',
                  holidays: [
                    {repeat_interval: 0, start_date: '2022-05-02T00:00:00.00Z'},
                    {repeat_interval: 0, start_date: '2022-05-03T00:00:00.00Z'}
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/holiday_groups/{id}';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri for year 2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri for year 2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
            };

            fetch('https://{baseurl}/api/holiday_groups/{id}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/holiday_groups/{id}",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"HolidayGroup\":{\"name\":\"Idul Fitri 2022\",\"description\":\"Idul Fitri for year 2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "HolidayGroup": {
                "name": "Idul Fitri 2022",
                "description": "Idul Fitri for year 2022",
                "holidays": [
                  {
                    "repeat_interval": 0,
                    "start_date": "2022-05-02T00:00:00.00Z"
                  },
                  {
                    "repeat_interval": 0,
                    "start_date": "2022-05-03T00:00:00.00Z"
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/holiday_groups/{id}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/holiday_groups/{id}", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/holiday_groups/{id}"


            payload = {"HolidayGroup": {
                    "name": "Idul Fitri 2022",
                    "description": "Idul Fitri for year 2022",
                    "holidays": [
                        {
                            "repeat_interval": 0,
                            "start_date": "2022-05-02T00:00:00.00Z"
                        },
                        {
                            "repeat_interval": 0,
                            "start_date": "2022-05-03T00:00:00.00Z"
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/holiday_groups/{id}")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/holiday_groups/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"HolidayGroup\":{\"name\":\"Idul Fitri 2022\",\"description\":\"Idul Fitri for year 2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/holiday_groups/{id}');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"HolidayGroup":{"name":"Idul Fitri
            2022","description":"Idul Fitri for year
            2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"HolidayGroup":{"name":"Idul Fitri
            2022","description":"Idul Fitri for year
            2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}');


            $request->setRequestUrl('https://{baseurl}/api/holiday_groups/{id}');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/holiday_groups/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/holiday_groups/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"HolidayGroup\":{\"name\":\"Idul Fitri 2022\",\"description\":\"Idul Fitri for year 2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/holiday_groups/{id}\"\n\n\tpayload := strings.NewReader(\"{\\\"HolidayGroup\\\":{\\\"name\\\":\\\"Idul Fitri 2022\\\",\\\"description\\\":\\\"Idul Fitri for year 2022\\\",\\\"holidays\\\":[{\\\"repeat_interval\\\":0,\\\"start_date\\\":\\\"2022-05-02T00:00:00.00Z\\\"},{\\\"repeat_interval\\\":0,\\\"start_date\\\":\\\"2022-05-03T00:00:00.00Z\\\"}]}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/holiday_groups/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"HolidayGroup": @{ @"name": @"Idul
            Fitri 2022", @"description": @"Idul Fitri for year 2022",
            @"holidays": @[ @{ @"repeat_interval": @0, @"start_date":
            @"2022-05-02T00:00:00.00Z" }, @{ @"repeat_interval": @0,
            @"start_date": @"2022-05-03T00:00:00.00Z" } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/holiday_groups/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["HolidayGroup": [
                "name": "Idul Fitri 2022",
                "description": "Idul Fitri for year 2022",
                "holidays": [
                  [
                    "repeat_interval": 0,
                    "start_date": "2022-05-02T00:00:00.00Z"
                  ],
                  [
                    "repeat_interval": 0,
                    "start_date": "2022-05-03T00:00:00.00Z"
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/holiday_groups/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/holiday_groups/{id}");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/holiday_groups/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"HolidayGroup\":{\"name\":\"Idul Fitri 2022\",\"description\":\"Idul Fitri for year 2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/holiday_groups/{id}' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri
            for year
            2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/holiday_groups/{id}' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"HolidayGroup":{"name":"Idul Fitri 2022","description":"Idul Fitri
            for year
            2022","holidays":[{"repeat_interval":0,"start_date":"2022-05-02T00:00:00.00Z"},{"repeat_interval":0,"start_date":"2022-05-03T00:00:00.00Z"}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/holiday_groups/{id}"


            payload <- "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/holiday_groups/{id}"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"HolidayGroup\":{\"name\":\"Idul Fitri
            2022\",\"description\":\"Idul Fitri for year
            2022\",\"holidays\":[{\"repeat_interval\":0,\"start_date\":\"2022-05-02T00:00:00.00Z\"},{\"repeat_interval\":0,\"start_date\":\"2022-05-03T00:00:00.00Z\"}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/holiday_groups/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Holiday Groups
      summary: Delete Holiday Group
      operationId: deleteHolidayGroup
      description: This API is used to delete holiday group.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the holiday group which will be deleted
          example: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url https://{baseurl}/api/holiday_groups/1 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE https://{baseurl}/api/holiday_groups/1 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/holiday_groups/1
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/holiday_groups/1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/holiday_groups/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/holiday_groups/1");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/holiday_groups/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/holiday_groups/1';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/holiday_groups/1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/holiday_groups/1",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/holiday_groups/1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/holiday_groups/1",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/holiday_groups/1"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("DELETE", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/holiday_groups/1")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/holiday_groups/1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/holiday_groups/1');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/holiday_groups/1');
            $request->setRequestMethod('DELETE');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/holiday_groups/1")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/holiday_groups/1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/holiday_groups/1\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/holiday_groups/1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/holiday_groups/1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/holiday_groups/1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/holiday_groups/1");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/holiday_groups/1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/holiday_groups/1' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/holiday_groups/1' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/holiday_groups/1"


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/holiday_groups/1" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/holiday_groups/1")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/trigger_actions:
    get:
      tags:
        - Trigger Actions
      summary: View Trigger Actions
      operationId: listTriggerActions
      description: This API is used to view all Trigger & Actions.
      parameters:
        - name: limit
          in: query
          schema:
            type: string
          description: >-
            Limit the number of responses by n records. Remove this parameter to
            view all.
        - name: offset
          in: query
          schema:
            type: string
          description: Offset the response shown by n records.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/trigger_actions',
              qs: {limit: 'SOME_STRING_VALUE', offset: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/trigger_actions");

            req.query({
              "limit": "SOME_STRING_VALUE",
              "offset": "SOME_STRING_VALUE"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/trigger_actions',
              params: {limit: 'SOME_STRING_VALUE', offset: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/trigger_actions"


            querystring =
            {"limit":"SOME_STRING_VALUE","offset":"SOME_STRING_VALUE"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/trigger_actions');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => 'SOME_STRING_VALUE',
              'offset' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/trigger_actions');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'limit' => 'SOME_STRING_VALUE',
              'offset' => 'SOME_STRING_VALUE'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/trigger_actions"


            queryString <- list(
              limit = "SOME_STRING_VALUE"
              offset = "SOME_STRING_VALUE",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/trigger_actions?limit=SOME_STRING_VALUE&offset=SOME_STRING_VALUE")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Trigger Actions
      summary: Create Trigger Actions (Zone)
      operationId: createTriggerActions
      description: >-
        You can set the device or BioStar X to do a specific operation when a
        specific event has occurred at the devices, doors and zones.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                TriggerAction:
                  $ref: '#/components/schemas/TriggerAction'
              example:
                TriggerAction:
                  name: Zone
                  priority: 0
                  schedule_id:
                    id: 4
                  trigger:
                    source_type: 3
                    event_types:
                      - code: 41472
                      - code: 38912
                    zones:
                      - id: '32794'
                      - id: '32793'
                  action:
                    email_action_id:
                      receipients:
                        - aaa@aaa.com
                    smtp_id:
                      id: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/trigger_actions \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"TriggerAction":{"name":"Zone","priority":0,"schedule_id":{"id":4},"trigger":{"source_type":3,"event_types":[{"code":41472},{"code":38912}],"zones":[{"id":"32794"},{"id":"32793"}]},"action":{"email_action_id":{"receipients":["aaa@aaa.com"]},"smtp_id":{"id":1}}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"TriggerAction":{"name":"Zone","priority":0,"schedule_id":{"id":4},"trigger":{"source_type":3,"event_types":[{"code":41472},{"code":38912}],"zones":[{"id":"32794"},{"id":"32793"}]},"action":{"email_action_id":{"receipients":["aaa@aaa.com"]},"smtp_id":{"id":1}}}}'
            |  \
              http POST https://{baseurl}/api/trigger_actions \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"TriggerAction":{"name":"Zone","priority":0,"schedule_id":{"id":4},"trigger":{"source_type":3,"event_types":[{"code":41472},{"code":38912}],"zones":[{"id":"32794"},{"id":"32793"}]},"action":{"email_action_id":{"receipients":["aaa@aaa.com"]},"smtp_id":{"id":1}}}}' \
              --output-document \
              - https://{baseurl}/api/trigger_actions
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/trigger_actions",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              TriggerAction: {
                name: 'Zone',
                priority: 0,
                schedule_id: {id: 4},
                trigger: {
                  source_type: 3,
                  event_types: [{code: 41472}, {code: 38912}],
                  zones: [{id: '32794'}, {id: '32793'}]
                },
                action: {email_action_id: {receipients: ['aaa@aaa.com']}, smtp_id: {id: 1}}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/trigger_actions',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                TriggerAction: {
                  name: 'Zone',
                  priority: 0,
                  schedule_id: {id: 4},
                  trigger: {
                    source_type: 3,
                    event_types: [{code: 41472}, {code: 38912}],
                    zones: [{id: '32794'}, {id: '32793'}]
                  },
                  action: {email_action_id: {receipients: ['aaa@aaa.com']}, smtp_id: {id: 1}}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/trigger_actions");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "TriggerAction": {
                "name": "Zone",
                "priority": 0,
                "schedule_id": {
                  "id": 4
                },
                "trigger": {
                  "source_type": 3,
                  "event_types": [
                    {
                      "code": 41472
                    },
                    {
                      "code": 38912
                    }
                  ],
                  "zones": [
                    {
                      "id": "32794"
                    },
                    {
                      "id": "32793"
                    }
                  ]
                },
                "action": {
                  "email_action_id": {
                    "receipients": [
                      "aaa@aaa.com"
                    ]
                  },
                  "smtp_id": {
                    "id": 1
                  }
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/trigger_actions',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                TriggerAction: {
                  name: 'Zone',
                  priority: 0,
                  schedule_id: {id: 4},
                  trigger: {
                    source_type: 3,
                    event_types: [{code: 41472}, {code: 38912}],
                    zones: [{id: '32794'}, {id: '32793'}]
                  },
                  action: {email_action_id: {receipients: ['aaa@aaa.com']}, smtp_id: {id: 1}}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/trigger_actions';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"TriggerAction":{"name":"Zone","priority":0,"schedule_id":{"id":4},"trigger":{"source_type":3,"event_types":[{"code":41472},{"code":38912}],"zones":[{"id":"32794"},{"id":"32793"}]},"action":{"email_action_id":{"receipients":["aaa@aaa.com"]},"smtp_id":{"id":1}}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"TriggerAction":{"name":"Zone","priority":0,"schedule_id":{"id":4},"trigger":{"source_type":3,"event_types":[{"code":41472},{"code":38912}],"zones":[{"id":"32794"},{"id":"32793"}]},"action":{"email_action_id":{"receipients":["aaa@aaa.com"]},"smtp_id":{"id":1}}}}'
            };

            fetch('https://{baseurl}/api/trigger_actions', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/trigger_actions",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "TriggerAction": {
                "name": "Zone",
                "priority": 0,
                "schedule_id": {
                  "id": 4
                },
                "trigger": {
                  "source_type": 3,
                  "event_types": [
                    {
                      "code": 41472
                    },
                    {
                      "code": 38912
                    }
                  ],
                  "zones": [
                    {
                      "id": "32794"
                    },
                    {
                      "id": "32793"
                    }
                  ]
                },
                "action": {
                  "email_action_id": {
                    "receipients": [
                      "aaa@aaa.com"
                    ]
                  },
                  "smtp_id": {
                    "id": 1
                  }
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/trigger_actions");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/trigger_actions", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/trigger_actions"


            payload = {"TriggerAction": {
                    "name": "Zone",
                    "priority": 0,
                    "schedule_id": {"id": 4},
                    "trigger": {
                        "source_type": 3,
                        "event_types": [{"code": 41472}, {"code": 38912}],
                        "zones": [{"id": "32794"}, {"id": "32793"}]
                    },
                    "action": {
                        "email_action_id": {"receipients": ["aaa@aaa.com"]},
                        "smtp_id": {"id": 1}
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/trigger_actions")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/trigger_actions",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/trigger_actions');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"TriggerAction":{"name":"Zone","priority":0,"schedule_id":{"id":4},"trigger":{"source_type":3,"event_types":[{"code":41472},{"code":38912}],"zones":[{"id":"32794"},{"id":"32793"}]},"action":{"email_action_id":{"receipients":["aaa@aaa.com"]},"smtp_id":{"id":1}}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"TriggerAction":{"name":"Zone","priority":0,"schedule_id":{"id":4},"trigger":{"source_type":3,"event_types":[{"code":41472},{"code":38912}],"zones":[{"id":"32794"},{"id":"32793"}]},"action":{"email_action_id":{"receipients":["aaa@aaa.com"]},"smtp_id":{"id":1}}}}');


            $request->setRequestUrl('https://{baseurl}/api/trigger_actions');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/trigger_actions")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/trigger_actions")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/trigger_actions\"\n\n\tpayload := strings.NewReader(\"{\\\"TriggerAction\\\":{\\\"name\\\":\\\"Zone\\\",\\\"priority\\\":0,\\\"schedule_id\\\":{\\\"id\\\":4},\\\"trigger\\\":{\\\"source_type\\\":3,\\\"event_types\\\":[{\\\"code\\\":41472},{\\\"code\\\":38912}],\\\"zones\\\":[{\\\"id\\\":\\\"32794\\\"},{\\\"id\\\":\\\"32793\\\"}]},\\\"action\\\":{\\\"email_action_id\\\":{\\\"receipients\\\":[\\\"aaa@aaa.com\\\"]},\\\"smtp_id\\\":{\\\"id\\\":1}}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/trigger_actions");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"TriggerAction": @{ @"name": @"Zone",
            @"priority": @0, @"schedule_id": @{ @"id": @4 }, @"trigger": @{
            @"source_type": @3, @"event_types": @[ @{ @"code": @41472 }, @{
            @"code": @38912 } ], @"zones": @[ @{ @"id": @"32794" }, @{ @"id":
            @"32793" } ] }, @"action": @{ @"email_action_id": @{ @"receipients":
            @[ @"aaa@aaa.com" ] }, @"smtp_id": @{ @"id": @1 } } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/trigger_actions"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["TriggerAction": [
                "name": "Zone",
                "priority": 0,
                "schedule_id": ["id": 4],
                "trigger": [
                  "source_type": 3,
                  "event_types": [["code": 41472], ["code": 38912]],
                  "zones": [["id": "32794"], ["id": "32793"]]
                ],
                "action": [
                  "email_action_id": ["receipients": ["aaa@aaa.com"]],
                  "smtp_id": ["id": 1]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/trigger_actions")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/trigger_actions");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/trigger_actions"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/trigger_actions' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"TriggerAction":{"name":"Zone","priority":0,"schedule_id":{"id":4},"trigger":{"source_type":3,"event_types":[{"code":41472},{"code":38912}],"zones":[{"id":"32794"},{"id":"32793"}]},"action":{"email_action_id":{"receipients":["aaa@aaa.com"]},"smtp_id":{"id":1}}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/trigger_actions' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"TriggerAction":{"name":"Zone","priority":0,"schedule_id":{"id":4},"trigger":{"source_type":3,"event_types":[{"code":41472},{"code":38912}],"zones":[{"id":"32794"},{"id":"32793"}]},"action":{"email_action_id":{"receipients":["aaa@aaa.com"]},"smtp_id":{"id":1}}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/trigger_actions"


            payload <-
            "{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/trigger_actions" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"TriggerAction\":{\"name\":\"Zone\",\"priority\":0,\"schedule_id\":{\"id\":4},\"trigger\":{\"source_type\":3,\"event_types\":[{\"code\":41472},{\"code\":38912}],\"zones\":[{\"id\":\"32794\"},{\"id\":\"32793\"}]},\"action\":{\"email_action_id\":{\"receipients\":[\"aaa@aaa.com\"]},\"smtp_id\":{\"id\":1}}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/trigger_actions")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/trigger_actions/{id}:
    put:
      tags:
        - Trigger Actions
      summary: Update Trigger Actions
      operationId: updateTriggerActions
      description: This API is used to update Trigger/Actions.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                TriggerAction:
                  $ref: '#/components/schemas/TriggerAction'
              example:
                TriggerAction:
                  name: Door
                  priority: 0
                  schedule_id:
                    id: 3
                  trigger:
                    source_type: 2
                    event_types:
                      - code: 21504
                    doors:
                      - id: 5
                      - id: 32
                  action:
                    email_action_id:
                      receipients:
                        - agni@oxx.id
                        - you@axx.id
                    smtp_id:
                      id: 1
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Trigger & Actions which will be updated.
          example: 2
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/trigger_actions/2 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"TriggerAction":{"name":"Door","priority":0,"schedule_id":{"id":3},"trigger":{"source_type":2,"event_types":[{"code":21504}],"doors":[{"id":5},{"id":32}]},"action":{"email_action_id":{"receipients":["agni@oxx.id","you@axx.id"]},"smtp_id":{"id":1}}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"TriggerAction":{"name":"Door","priority":0,"schedule_id":{"id":3},"trigger":{"source_type":2,"event_types":[{"code":21504}],"doors":[{"id":5},{"id":32}]},"action":{"email_action_id":{"receipients":["agni@oxx.id","you@axx.id"]},"smtp_id":{"id":1}}}}'
            |  \
              http PUT https://{baseurl}/api/trigger_actions/2 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"TriggerAction":{"name":"Door","priority":0,"schedule_id":{"id":3},"trigger":{"source_type":2,"event_types":[{"code":21504}],"doors":[{"id":5},{"id":32}]},"action":{"email_action_id":{"receipients":["agni@oxx.id","you@axx.id"]},"smtp_id":{"id":1}}}}' \
              --output-document \
              - https://{baseurl}/api/trigger_actions/2
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/trigger_actions/2",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              TriggerAction: {
                name: 'Door',
                priority: 0,
                schedule_id: {id: 3},
                trigger: {source_type: 2, event_types: [{code: 21504}], doors: [{id: 5}, {id: 32}]},
                action: {
                  email_action_id: {receipients: ['agni@oxx.id', 'you@axx.id']},
                  smtp_id: {id: 1}
                }
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/trigger_actions/2',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                TriggerAction: {
                  name: 'Door',
                  priority: 0,
                  schedule_id: {id: 3},
                  trigger: {source_type: 2, event_types: [{code: 21504}], doors: [{id: 5}, {id: 32}]},
                  action: {
                    email_action_id: {receipients: ['agni@oxx.id', 'you@axx.id']},
                    smtp_id: {id: 1}
                  }
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/trigger_actions/2");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "TriggerAction": {
                "name": "Door",
                "priority": 0,
                "schedule_id": {
                  "id": 3
                },
                "trigger": {
                  "source_type": 2,
                  "event_types": [
                    {
                      "code": 21504
                    }
                  ],
                  "doors": [
                    {
                      "id": 5
                    },
                    {
                      "id": 32
                    }
                  ]
                },
                "action": {
                  "email_action_id": {
                    "receipients": [
                      "agni@oxx.id",
                      "you@axx.id"
                    ]
                  },
                  "smtp_id": {
                    "id": 1
                  }
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/trigger_actions/2',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                TriggerAction: {
                  name: 'Door',
                  priority: 0,
                  schedule_id: {id: 3},
                  trigger: {source_type: 2, event_types: [{code: 21504}], doors: [{id: 5}, {id: 32}]},
                  action: {
                    email_action_id: {receipients: ['agni@oxx.id', 'you@axx.id']},
                    smtp_id: {id: 1}
                  }
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/trigger_actions/2';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"TriggerAction":{"name":"Door","priority":0,"schedule_id":{"id":3},"trigger":{"source_type":2,"event_types":[{"code":21504}],"doors":[{"id":5},{"id":32}]},"action":{"email_action_id":{"receipients":["agni@oxx.id","you@axx.id"]},"smtp_id":{"id":1}}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"TriggerAction":{"name":"Door","priority":0,"schedule_id":{"id":3},"trigger":{"source_type":2,"event_types":[{"code":21504}],"doors":[{"id":5},{"id":32}]},"action":{"email_action_id":{"receipients":["agni@oxx.id","you@axx.id"]},"smtp_id":{"id":1}}}}'
            };

            fetch('https://{baseurl}/api/trigger_actions/2', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/trigger_actions/2",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "TriggerAction": {
                "name": "Door",
                "priority": 0,
                "schedule_id": {
                  "id": 3
                },
                "trigger": {
                  "source_type": 2,
                  "event_types": [
                    {
                      "code": 21504
                    }
                  ],
                  "doors": [
                    {
                      "id": 5
                    },
                    {
                      "id": 32
                    }
                  ]
                },
                "action": {
                  "email_action_id": {
                    "receipients": [
                      "agni@oxx.id",
                      "you@axx.id"
                    ]
                  },
                  "smtp_id": {
                    "id": 1
                  }
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/trigger_actions/2");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/trigger_actions/2", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/trigger_actions/2"


            payload = {"TriggerAction": {
                    "name": "Door",
                    "priority": 0,
                    "schedule_id": {"id": 3},
                    "trigger": {
                        "source_type": 2,
                        "event_types": [{"code": 21504}],
                        "doors": [{"id": 5}, {"id": 32}]
                    },
                    "action": {
                        "email_action_id": {"receipients": ["agni@oxx.id", "you@axx.id"]},
                        "smtp_id": {"id": 1}
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/trigger_actions/2")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/trigger_actions/2",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/trigger_actions/2');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"TriggerAction":{"name":"Door","priority":0,"schedule_id":{"id":3},"trigger":{"source_type":2,"event_types":[{"code":21504}],"doors":[{"id":5},{"id":32}]},"action":{"email_action_id":{"receipients":["agni@oxx.id","you@axx.id"]},"smtp_id":{"id":1}}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"TriggerAction":{"name":"Door","priority":0,"schedule_id":{"id":3},"trigger":{"source_type":2,"event_types":[{"code":21504}],"doors":[{"id":5},{"id":32}]},"action":{"email_action_id":{"receipients":["agni@oxx.id","you@axx.id"]},"smtp_id":{"id":1}}}}');


            $request->setRequestUrl('https://{baseurl}/api/trigger_actions/2');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/trigger_actions/2")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/trigger_actions/2")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/trigger_actions/2\"\n\n\tpayload := strings.NewReader(\"{\\\"TriggerAction\\\":{\\\"name\\\":\\\"Door\\\",\\\"priority\\\":0,\\\"schedule_id\\\":{\\\"id\\\":3},\\\"trigger\\\":{\\\"source_type\\\":2,\\\"event_types\\\":[{\\\"code\\\":21504}],\\\"doors\\\":[{\\\"id\\\":5},{\\\"id\\\":32}]},\\\"action\\\":{\\\"email_action_id\\\":{\\\"receipients\\\":[\\\"agni@oxx.id\\\",\\\"you@axx.id\\\"]},\\\"smtp_id\\\":{\\\"id\\\":1}}}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/trigger_actions/2");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"TriggerAction": @{ @"name": @"Door",
            @"priority": @0, @"schedule_id": @{ @"id": @3 }, @"trigger": @{
            @"source_type": @2, @"event_types": @[ @{ @"code": @21504 } ],
            @"doors": @[ @{ @"id": @5 }, @{ @"id": @32 } ] }, @"action": @{
            @"email_action_id": @{ @"receipients": @[ @"agni@oxx.id",
            @"you@axx.id" ] }, @"smtp_id": @{ @"id": @1 } } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/trigger_actions/2"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["TriggerAction": [
                "name": "Door",
                "priority": 0,
                "schedule_id": ["id": 3],
                "trigger": [
                  "source_type": 2,
                  "event_types": [["code": 21504]],
                  "doors": [["id": 5], ["id": 32]]
                ],
                "action": [
                  "email_action_id": ["receipients": ["agni@oxx.id", "you@axx.id"]],
                  "smtp_id": ["id": 1]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/trigger_actions/2")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/trigger_actions/2");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/trigger_actions/2"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/trigger_actions/2' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"TriggerAction":{"name":"Door","priority":0,"schedule_id":{"id":3},"trigger":{"source_type":2,"event_types":[{"code":21504}],"doors":[{"id":5},{"id":32}]},"action":{"email_action_id":{"receipients":["agni@oxx.id","you@axx.id"]},"smtp_id":{"id":1}}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/trigger_actions/2' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"TriggerAction":{"name":"Door","priority":0,"schedule_id":{"id":3},"trigger":{"source_type":2,"event_types":[{"code":21504}],"doors":[{"id":5},{"id":32}]},"action":{"email_action_id":{"receipients":["agni@oxx.id","you@axx.id"]},"smtp_id":{"id":1}}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/trigger_actions/2"


            payload <-
            "{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/trigger_actions/2" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"TriggerAction\":{\"name\":\"Door\",\"priority\":0,\"schedule_id\":{\"id\":3},\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":21504}],\"doors\":[{\"id\":5},{\"id\":32}]},\"action\":{\"email_action_id\":{\"receipients\":[\"agni@oxx.id\",\"you@axx.id\"]},\"smtp_id\":{\"id\":1}}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/trigger_actions/2")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Trigger Actions
      summary: Delete Trigger Actions
      operationId: deleteTriggerActions
      description: This API is used to view all Trigger & Actions.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Trigger & Action which will be deleted.
          example: 2
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url https://{baseurl}/api/trigger_actions/2 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE https://{baseurl}/api/trigger_actions/2 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/trigger_actions/2
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/trigger_actions/2",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/trigger_actions/2',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/trigger_actions/2");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/trigger_actions/2',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/trigger_actions/2';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/trigger_actions/2', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/trigger_actions/2",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/trigger_actions/2");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/trigger_actions/2",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/trigger_actions/2"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("DELETE", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/trigger_actions/2")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/trigger_actions/2",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/trigger_actions/2');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/trigger_actions/2');
            $request->setRequestMethod('DELETE');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/trigger_actions/2")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/trigger_actions/2")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/trigger_actions/2\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/trigger_actions/2");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/trigger_actions/2"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/trigger_actions/2")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/trigger_actions/2");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/trigger_actions/2"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/trigger_actions/2' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/trigger_actions/2' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/trigger_actions/2"


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/trigger_actions/2" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/trigger_actions/2")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/multiple/trigger_actions:
    post:
      tags:
        - Trigger Actions
      summary: Create Multiple Trigger Actions
      operationId: createMultipleTriggerActions
      description: This API is used to create multiple trigger actions.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                TriggerAction:
                  $ref: '#/components/schemas/MultipleTriggerAction'
              example:
                TriggerAction:
                  name: sample triggeraction
                  priority: 0
                  schedule_id:
                    id: 1
                  is_quick_action: 'N'
                  trigger:
                    source_type: 2
                    event_types:
                      - code: 22016
                    devices: []
                    doors:
                      - id: 1
                    zones: []
                  action:
                    device_action_id:
                      device_id:
                        id: 50355072
                      relay_signal_id:
                        id: 1
                      relay_index: 0
                    email_action_id:
                      receipients:
                        - abc@xyz.co
                        - abe@xyz.co
                    smtp_id:
                      id: 1
                    door_action:
                      - door_id:
                          id: 1
                        door_signal: 346
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  TriggerAction:
                    type: object
                    properties:
                      name:
                        type: string
                        example: ta 1
                      priority:
                        type: integer
                        example: 0
                      trigger:
                        type: object
                        properties:
                          source_type:
                            type: integer
                            example: 1
                      schedule_id:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                      action:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 800001
                          device_action_id:
                            type: object
                            properties:
                              device_id:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 50355260
                              relay_index:
                                type: integer
                                example: 0
                              relay_signal_id:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 1
                          email_action_id:
                            type: object
                            properties:
                              receipients:
                                type: array
                                items:
                                  type: string
                                example:
                                  - wawe@test.com
                          smtp_id:
                            type: object
                            properties:
                              id:
                                type: integer
                                example: 1
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/multiple/trigger_actions \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"TriggerAction":{"name":"sample triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc@xyz.co","abe@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"TriggerAction":{"name":"sample
            triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc@xyz.co","abe@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
            |  \
              http POST https://{baseurl}/api/multiple/trigger_actions \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"TriggerAction":{"name":"sample triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc@xyz.co","abe@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}' \
              --output-document \
              - https://{baseurl}/api/multiple/trigger_actions
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/multiple/trigger_actions",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              TriggerAction: {
                name: 'sample triggeraction',
                priority: 0,
                schedule_id: {id: 1},
                is_quick_action: 'N',
                trigger: {
                  source_type: 2,
                  event_types: [{code: 22016}],
                  devices: [],
                  doors: [{id: 1}],
                  zones: []
                },
                action: {
                  device_action_id: {device_id: {id: 50355072}, relay_signal_id: {id: 1}, relay_index: 0},
                  email_action_id: {receipients: ['abc@xyz.co', 'abe@xyz.co']},
                  smtp_id: {id: 1},
                  door_action: [{door_id: {id: 1}, door_signal: 346}]
                }
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/multiple/trigger_actions',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                TriggerAction: {
                  name: 'sample triggeraction',
                  priority: 0,
                  schedule_id: {id: 1},
                  is_quick_action: 'N',
                  trigger: {
                    source_type: 2,
                    event_types: [{code: 22016}],
                    devices: [],
                    doors: [{id: 1}],
                    zones: []
                  },
                  action: {
                    device_action_id: {device_id: {id: 50355072}, relay_signal_id: {id: 1}, relay_index: 0},
                    email_action_id: {receipients: ['abc@xyz.co', 'abe@xyz.co']},
                    smtp_id: {id: 1},
                    door_action: [{door_id: {id: 1}, door_signal: 346}]
                  }
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/multiple/trigger_actions");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "TriggerAction": {
                "name": "sample triggeraction",
                "priority": 0,
                "schedule_id": {
                  "id": 1
                },
                "is_quick_action": "N",
                "trigger": {
                  "source_type": 2,
                  "event_types": [
                    {
                      "code": 22016
                    }
                  ],
                  "devices": [],
                  "doors": [
                    {
                      "id": 1
                    }
                  ],
                  "zones": []
                },
                "action": {
                  "device_action_id": {
                    "device_id": {
                      "id": 50355072
                    },
                    "relay_signal_id": {
                      "id": 1
                    },
                    "relay_index": 0
                  },
                  "email_action_id": {
                    "receipients": [
                      "abc@xyz.co",
                      "abe@xyz.co"
                    ]
                  },
                  "smtp_id": {
                    "id": 1
                  },
                  "door_action": [
                    {
                      "door_id": {
                        "id": 1
                      },
                      "door_signal": 346
                    }
                  ]
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/multiple/trigger_actions',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                TriggerAction: {
                  name: 'sample triggeraction',
                  priority: 0,
                  schedule_id: {id: 1},
                  is_quick_action: 'N',
                  trigger: {
                    source_type: 2,
                    event_types: [{code: 22016}],
                    devices: [],
                    doors: [{id: 1}],
                    zones: []
                  },
                  action: {
                    device_action_id: {device_id: {id: 50355072}, relay_signal_id: {id: 1}, relay_index: 0},
                    email_action_id: {receipients: ['abc@xyz.co', 'abe@xyz.co']},
                    smtp_id: {id: 1},
                    door_action: [{door_id: {id: 1}, door_signal: 346}]
                  }
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/multiple/trigger_actions';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"TriggerAction":{"name":"sample triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc@xyz.co","abe@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"TriggerAction":{"name":"sample triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc@xyz.co","abe@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
            };

            fetch('https://{baseurl}/api/multiple/trigger_actions', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/multiple/trigger_actions",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"TriggerAction\":{\"name\":\"sample triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "TriggerAction": {
                "name": "sample triggeraction",
                "priority": 0,
                "schedule_id": {
                  "id": 1
                },
                "is_quick_action": "N",
                "trigger": {
                  "source_type": 2,
                  "event_types": [
                    {
                      "code": 22016
                    }
                  ],
                  "devices": [],
                  "doors": [
                    {
                      "id": 1
                    }
                  ],
                  "zones": []
                },
                "action": {
                  "device_action_id": {
                    "device_id": {
                      "id": 50355072
                    },
                    "relay_signal_id": {
                      "id": 1
                    },
                    "relay_index": 0
                  },
                  "email_action_id": {
                    "receipients": [
                      "abc@xyz.co",
                      "abe@xyz.co"
                    ]
                  },
                  "smtp_id": {
                    "id": 1
                  },
                  "door_action": [
                    {
                      "door_id": {
                        "id": 1
                      },
                      "door_signal": 346
                    }
                  ]
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/multiple/trigger_actions");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/multiple/trigger_actions",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/multiple/trigger_actions"


            payload = {"TriggerAction": {
                    "name": "sample triggeraction",
                    "priority": 0,
                    "schedule_id": {"id": 1},
                    "is_quick_action": "N",
                    "trigger": {
                        "source_type": 2,
                        "event_types": [{"code": 22016}],
                        "devices": [],
                        "doors": [{"id": 1}],
                        "zones": []
                    },
                    "action": {
                        "device_action_id": {
                            "device_id": {"id": 50355072},
                            "relay_signal_id": {"id": 1},
                            "relay_index": 0
                        },
                        "email_action_id": {"receipients": ["abc@xyz.co", "abe@xyz.co"]},
                        "smtp_id": {"id": 1},
                        "door_action": [
                            {
                                "door_id": {"id": 1},
                                "door_signal": 346
                            }
                        ]
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/multiple/trigger_actions")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/multiple/trigger_actions",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"TriggerAction\":{\"name\":\"sample triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/multiple/trigger_actions');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"TriggerAction":{"name":"sample
            triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc@xyz.co","abe@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"TriggerAction":{"name":"sample
            triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc@xyz.co","abe@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}');


            $request->setRequestUrl('https://{baseurl}/api/multiple/trigger_actions');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/multiple/trigger_actions")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/multiple/trigger_actions")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"TriggerAction\":{\"name\":\"sample triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/multiple/trigger_actions\"\n\n\tpayload := strings.NewReader(\"{\\\"TriggerAction\\\":{\\\"name\\\":\\\"sample triggeraction\\\",\\\"priority\\\":0,\\\"schedule_id\\\":{\\\"id\\\":1},\\\"is_quick_action\\\":\\\"N\\\",\\\"trigger\\\":{\\\"source_type\\\":2,\\\"event_types\\\":[{\\\"code\\\":22016}],\\\"devices\\\":[],\\\"doors\\\":[{\\\"id\\\":1}],\\\"zones\\\":[]},\\\"action\\\":{\\\"device_action_id\\\":{\\\"device_id\\\":{\\\"id\\\":50355072},\\\"relay_signal_id\\\":{\\\"id\\\":1},\\\"relay_index\\\":0},\\\"email_action_id\\\":{\\\"receipients\\\":[\\\"abc@xyz.co\\\",\\\"abe@xyz.co\\\"]},\\\"smtp_id\\\":{\\\"id\\\":1},\\\"door_action\\\":[{\\\"door_id\\\":{\\\"id\\\":1},\\\"door_signal\\\":346}]}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/multiple/trigger_actions");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"TriggerAction": @{ @"name": @"sample
            triggeraction", @"priority": @0, @"schedule_id": @{ @"id": @1 },
            @"is_quick_action": @"N", @"trigger": @{ @"source_type": @2,
            @"event_types": @[ @{ @"code": @22016 } ], @"devices": @[  ],
            @"doors": @[ @{ @"id": @1 } ], @"zones": @[  ] }, @"action": @{
            @"device_action_id": @{ @"device_id": @{ @"id": @50355072 },
            @"relay_signal_id": @{ @"id": @1 }, @"relay_index": @0 },
            @"email_action_id": @{ @"receipients": @[ @"abc@xyz.co",
            @"abe@xyz.co" ] }, @"smtp_id": @{ @"id": @1 }, @"door_action": @[ @{
            @"door_id": @{ @"id": @1 }, @"door_signal": @346 } ] } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/multiple/trigger_actions"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["TriggerAction": [
                "name": "sample triggeraction",
                "priority": 0,
                "schedule_id": ["id": 1],
                "is_quick_action": "N",
                "trigger": [
                  "source_type": 2,
                  "event_types": [["code": 22016]],
                  "devices": [],
                  "doors": [["id": 1]],
                  "zones": []
                ],
                "action": [
                  "device_action_id": [
                    "device_id": ["id": 50355072],
                    "relay_signal_id": ["id": 1],
                    "relay_index": 0
                  ],
                  "email_action_id": ["receipients": ["abc@xyz.co", "abe@xyz.co"]],
                  "smtp_id": ["id": 1],
                  "door_action": [
                    [
                      "door_id": ["id": 1],
                      "door_signal": 346
                    ]
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/multiple/trigger_actions")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/multiple/trigger_actions");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/multiple/trigger_actions"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"TriggerAction\":{\"name\":\"sample triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/multiple/trigger_actions' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"TriggerAction":{"name":"sample
            triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc@xyz.co","abe@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/multiple/trigger_actions' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"TriggerAction":{"name":"sample
            triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc@xyz.co","abe@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/multiple/trigger_actions"


            payload <- "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/multiple/trigger_actions" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc@xyz.co\",\"abe@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/multiple/trigger_actions")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Trigger Actions
      summary: Delete Multiple Trigger Actions Copy
      operationId: deleteMultipleTriggerActions
      description: This API is used to delete multiple trigger actions by ID.
      parameters:
        - name: id
          in: query
          schema:
            type: string
          description: >-
            Trigger and Action ID(s). Delimit each ID by using plus symbol (+;
            ex: 1+2+3)
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http DELETE
            'https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/multiple/trigger_actions',
              qs: {id: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/multiple/trigger_actions");


            req.query({
              "id": "SOME_STRING_VALUE"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/multiple/trigger_actions',
              params: {id: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("DELETE",
            "https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE",
            "{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/multiple/trigger_actions"


            querystring = {"id":"SOME_STRING_VALUE"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Delete.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/multiple/trigger_actions');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/multiple/trigger_actions');

            $request->setRequestMethod('DELETE');

            $request->setQuery(new http\QueryString([
              'id' => 'SOME_STRING_VALUE'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE'
            -Method DELETE -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE'
            -Method DELETE -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/multiple/trigger_actions"


            queryString <- list([ 'id' ] = "SOME_STRING_VALUE")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/multiple/trigger_actions?id=SOME_STRING_VALUE")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/multiple/trigger_actions/{id}:
    put:
      tags:
        - Trigger Actions
      summary: Update Multiple Trigger Actions
      operationId: updateMultipleTriggerActions
      description: This API is used to update multiple trigger actions by ID.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                TriggerAction:
                  $ref: '#/components/schemas/MultipleTriggerAction'
              example:
                TriggerAction:
                  name: sample triggeraction
                  priority: 0
                  schedule_id:
                    id: 1
                  is_quick_action: 'N'
                  trigger:
                    source_type: 2
                    event_types:
                      - code: 22016
                    devices: []
                    doors:
                      - id: 1
                    zones: []
                  action:
                    device_action_id:
                      device_id:
                        id: 50355072
                      relay_signal_id:
                        id: 1
                      relay_index: 0
                    email_action_id:
                      receipients:
                        - abc1@xyz.co
                        - abe2@xyz.co
                    smtp_id:
                      id: 1
                    door_action:
                      - door_id:
                          id: 1
                        door_signal: 346
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: Trigger & Action's ID
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/multiple/trigger_actions/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"TriggerAction":{"name":"sample triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc1@xyz.co","abe2@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"TriggerAction":{"name":"sample
            triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc1@xyz.co","abe2@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
            |  \
              http PUT https://{baseurl}/api/multiple/trigger_actions/{id} \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"TriggerAction":{"name":"sample triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc1@xyz.co","abe2@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}' \
              --output-document \
              - https://{baseurl}/api/multiple/trigger_actions/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/multiple/trigger_actions/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              TriggerAction: {
                name: 'sample triggeraction',
                priority: 0,
                schedule_id: {id: 1},
                is_quick_action: 'N',
                trigger: {
                  source_type: 2,
                  event_types: [{code: 22016}],
                  devices: [],
                  doors: [{id: 1}],
                  zones: []
                },
                action: {
                  device_action_id: {device_id: {id: 50355072}, relay_signal_id: {id: 1}, relay_index: 0},
                  email_action_id: {receipients: ['abc1@xyz.co', 'abe2@xyz.co']},
                  smtp_id: {id: 1},
                  door_action: [{door_id: {id: 1}, door_signal: 346}]
                }
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/multiple/trigger_actions/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                TriggerAction: {
                  name: 'sample triggeraction',
                  priority: 0,
                  schedule_id: {id: 1},
                  is_quick_action: 'N',
                  trigger: {
                    source_type: 2,
                    event_types: [{code: 22016}],
                    devices: [],
                    doors: [{id: 1}],
                    zones: []
                  },
                  action: {
                    device_action_id: {device_id: {id: 50355072}, relay_signal_id: {id: 1}, relay_index: 0},
                    email_action_id: {receipients: ['abc1@xyz.co', 'abe2@xyz.co']},
                    smtp_id: {id: 1},
                    door_action: [{door_id: {id: 1}, door_signal: 346}]
                  }
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/multiple/trigger_actions/{id}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "TriggerAction": {
                "name": "sample triggeraction",
                "priority": 0,
                "schedule_id": {
                  "id": 1
                },
                "is_quick_action": "N",
                "trigger": {
                  "source_type": 2,
                  "event_types": [
                    {
                      "code": 22016
                    }
                  ],
                  "devices": [],
                  "doors": [
                    {
                      "id": 1
                    }
                  ],
                  "zones": []
                },
                "action": {
                  "device_action_id": {
                    "device_id": {
                      "id": 50355072
                    },
                    "relay_signal_id": {
                      "id": 1
                    },
                    "relay_index": 0
                  },
                  "email_action_id": {
                    "receipients": [
                      "abc1@xyz.co",
                      "abe2@xyz.co"
                    ]
                  },
                  "smtp_id": {
                    "id": 1
                  },
                  "door_action": [
                    {
                      "door_id": {
                        "id": 1
                      },
                      "door_signal": 346
                    }
                  ]
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/multiple/trigger_actions/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                TriggerAction: {
                  name: 'sample triggeraction',
                  priority: 0,
                  schedule_id: {id: 1},
                  is_quick_action: 'N',
                  trigger: {
                    source_type: 2,
                    event_types: [{code: 22016}],
                    devices: [],
                    doors: [{id: 1}],
                    zones: []
                  },
                  action: {
                    device_action_id: {device_id: {id: 50355072}, relay_signal_id: {id: 1}, relay_index: 0},
                    email_action_id: {receipients: ['abc1@xyz.co', 'abe2@xyz.co']},
                    smtp_id: {id: 1},
                    door_action: [{door_id: {id: 1}, door_signal: 346}]
                  }
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/multiple/trigger_actions/{id}';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"TriggerAction":{"name":"sample triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc1@xyz.co","abe2@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"TriggerAction":{"name":"sample triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc1@xyz.co","abe2@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
            };


            fetch('https://{baseurl}/api/multiple/trigger_actions/{id}',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/multiple/trigger_actions/{id}",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"TriggerAction\":{\"name\":\"sample triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "TriggerAction": {
                "name": "sample triggeraction",
                "priority": 0,
                "schedule_id": {
                  "id": 1
                },
                "is_quick_action": "N",
                "trigger": {
                  "source_type": 2,
                  "event_types": [
                    {
                      "code": 22016
                    }
                  ],
                  "devices": [],
                  "doors": [
                    {
                      "id": 1
                    }
                  ],
                  "zones": []
                },
                "action": {
                  "device_action_id": {
                    "device_id": {
                      "id": 50355072
                    },
                    "relay_signal_id": {
                      "id": 1
                    },
                    "relay_index": 0
                  },
                  "email_action_id": {
                    "receipients": [
                      "abc1@xyz.co",
                      "abe2@xyz.co"
                    ]
                  },
                  "smtp_id": {
                    "id": 1
                  },
                  "door_action": [
                    {
                      "door_id": {
                        "id": 1
                      },
                      "door_signal": 346
                    }
                  ]
                }
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("PUT",
            "https://{baseurl}/api/multiple/trigger_actions/{id}");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/multiple/trigger_actions/{id}",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/multiple/trigger_actions/{id}"


            payload = {"TriggerAction": {
                    "name": "sample triggeraction",
                    "priority": 0,
                    "schedule_id": {"id": 1},
                    "is_quick_action": "N",
                    "trigger": {
                        "source_type": 2,
                        "event_types": [{"code": 22016}],
                        "devices": [],
                        "doors": [{"id": 1}],
                        "zones": []
                    },
                    "action": {
                        "device_action_id": {
                            "device_id": {"id": 50355072},
                            "relay_signal_id": {"id": 1},
                            "relay_index": 0
                        },
                        "email_action_id": {"receipients": ["abc1@xyz.co", "abe2@xyz.co"]},
                        "smtp_id": {"id": 1},
                        "door_action": [
                            {
                                "door_id": {"id": 1},
                                "door_signal": 346
                            }
                        ]
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/multiple/trigger_actions/{id}")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/multiple/trigger_actions/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"TriggerAction\":{\"name\":\"sample triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/multiple/trigger_actions/{id}');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"TriggerAction":{"name":"sample
            triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc1@xyz.co","abe2@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"TriggerAction":{"name":"sample
            triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc1@xyz.co","abe2@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}');


            $request->setRequestUrl('https://{baseurl}/api/multiple/trigger_actions/{id}');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/multiple/trigger_actions/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/multiple/trigger_actions/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"TriggerAction\":{\"name\":\"sample triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/multiple/trigger_actions/{id}\"\n\n\tpayload := strings.NewReader(\"{\\\"TriggerAction\\\":{\\\"name\\\":\\\"sample triggeraction\\\",\\\"priority\\\":0,\\\"schedule_id\\\":{\\\"id\\\":1},\\\"is_quick_action\\\":\\\"N\\\",\\\"trigger\\\":{\\\"source_type\\\":2,\\\"event_types\\\":[{\\\"code\\\":22016}],\\\"devices\\\":[],\\\"doors\\\":[{\\\"id\\\":1}],\\\"zones\\\":[]},\\\"action\\\":{\\\"device_action_id\\\":{\\\"device_id\\\":{\\\"id\\\":50355072},\\\"relay_signal_id\\\":{\\\"id\\\":1},\\\"relay_index\\\":0},\\\"email_action_id\\\":{\\\"receipients\\\":[\\\"abc1@xyz.co\\\",\\\"abe2@xyz.co\\\"]},\\\"smtp_id\\\":{\\\"id\\\":1},\\\"door_action\\\":[{\\\"door_id\\\":{\\\"id\\\":1},\\\"door_signal\\\":346}]}}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/multiple/trigger_actions/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"TriggerAction": @{ @"name": @"sample
            triggeraction", @"priority": @0, @"schedule_id": @{ @"id": @1 },
            @"is_quick_action": @"N", @"trigger": @{ @"source_type": @2,
            @"event_types": @[ @{ @"code": @22016 } ], @"devices": @[  ],
            @"doors": @[ @{ @"id": @1 } ], @"zones": @[  ] }, @"action": @{
            @"device_action_id": @{ @"device_id": @{ @"id": @50355072 },
            @"relay_signal_id": @{ @"id": @1 }, @"relay_index": @0 },
            @"email_action_id": @{ @"receipients": @[ @"abc1@xyz.co",
            @"abe2@xyz.co" ] }, @"smtp_id": @{ @"id": @1 }, @"door_action": @[
            @{ @"door_id": @{ @"id": @1 }, @"door_signal": @346 } ] } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/multiple/trigger_actions/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["TriggerAction": [
                "name": "sample triggeraction",
                "priority": 0,
                "schedule_id": ["id": 1],
                "is_quick_action": "N",
                "trigger": [
                  "source_type": 2,
                  "event_types": [["code": 22016]],
                  "devices": [],
                  "doors": [["id": 1]],
                  "zones": []
                ],
                "action": [
                  "device_action_id": [
                    "device_id": ["id": 50355072],
                    "relay_signal_id": ["id": 1],
                    "relay_index": 0
                  ],
                  "email_action_id": ["receipients": ["abc1@xyz.co", "abe2@xyz.co"]],
                  "smtp_id": ["id": 1],
                  "door_action": [
                    [
                      "door_id": ["id": 1],
                      "door_signal": 346
                    ]
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/multiple/trigger_actions/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/multiple/trigger_actions/{id}");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/multiple/trigger_actions/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"TriggerAction\":{\"name\":\"sample triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/multiple/trigger_actions/{id}' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"TriggerAction":{"name":"sample
            triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc1@xyz.co","abe2@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/multiple/trigger_actions/{id}' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"TriggerAction":{"name":"sample
            triggeraction","priority":0,"schedule_id":{"id":1},"is_quick_action":"N","trigger":{"source_type":2,"event_types":[{"code":22016}],"devices":[],"doors":[{"id":1}],"zones":[]},"action":{"device_action_id":{"device_id":{"id":50355072},"relay_signal_id":{"id":1},"relay_index":0},"email_action_id":{"receipients":["abc1@xyz.co","abe2@xyz.co"]},"smtp_id":{"id":1},"door_action":[{"door_id":{"id":1},"door_signal":346}]}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/multiple/trigger_actions/{id}"


            payload <- "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/multiple/trigger_actions/{id}" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"TriggerAction\":{\"name\":\"sample
            triggeraction\",\"priority\":0,\"schedule_id\":{\"id\":1},\"is_quick_action\":\"N\",\"trigger\":{\"source_type\":2,\"event_types\":[{\"code\":22016}],\"devices\":[],\"doors\":[{\"id\":1}],\"zones\":[]},\"action\":{\"device_action_id\":{\"device_id\":{\"id\":50355072},\"relay_signal_id\":{\"id\":1},\"relay_index\":0},\"email_action_id\":{\"receipients\":[\"abc1@xyz.co\",\"abe2@xyz.co\"]},\"smtp_id\":{\"id\":1},\"door_action\":[{\"door_id\":{\"id\":1},\"door_signal\":346}]}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/multiple/trigger_actions/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Trigger Actions
      summary: View Multiple Trigger Actions
      operationId: listMultipleTriggerActions
      description: This API is used to view trigger actions by ID.
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the Trigger and Action which will be viewed.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  TriggerAction:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The trigger action name.
                        example: sample triggeraction
                      priority:
                        type: integer
                        example: 0
                      trigger:
                        type: object
                        properties:
                          source_type:
                            type: integer
                            example: 2
                          doors:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: integer
                                  example: 1
                                name:
                                  type: string
                                  example: door1
                          event_types:
                            type: array
                            items:
                              type: object
                              properties:
                                code:
                                  type: integer
                                  example: 22016
                                name:
                                  type: string
                                  example: FORCED_OPEN_ALARM
                      schedule_id:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          name:
                            type: string
                            example: Always
                      action:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          device_action_id:
                            type: object
                            properties:
                              device_id:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 50355072
                              relay_index:
                                type: integer
                                example: 0
                              relay_signal_id:
                                type: object
                                properties:
                                  id:
                                    type: integer
                                    example: 1
                                  name:
                                    type: string
                                    example: Relay Signal 1
                                  delay:
                                    type: integer
                                    example: 0
                                  count:
                                    type: integer
                                    example: 0
                                  on_duration:
                                    type: integer
                                    example: 0
                                  off_duration:
                                    type: integer
                                    example: 0
                          email_action_id:
                            type: object
                            properties:
                              receipients:
                                type: array
                                items:
                                  type: string
                                example:
                                  - abc@xyz.co
                          smtp_id:
                            type: object
                            properties:
                              id:
                                type: integer
                                example: 1
                              name:
                                type: string
                                example: SMTP Server
                              smtp_server_addr:
                                type: string
                                example: smtp.example.com
                              smtp_server_port:
                                type: integer
                                example: 587
                              smtp_security:
                                type: integer
                                example: 1
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/multiple/trigger_actions/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/multiple/trigger_actions/{id} \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/multiple/trigger_actions/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/multiple/trigger_actions/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/multiple/trigger_actions/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/multiple/trigger_actions/{id}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/multiple/trigger_actions/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/multiple/trigger_actions/{id}';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/multiple/trigger_actions/{id}',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/multiple/trigger_actions/{id}",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/multiple/trigger_actions/{id}");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/multiple/trigger_actions/{id}",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/multiple/trigger_actions/{id}"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/multiple/trigger_actions/{id}")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/multiple/trigger_actions/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/multiple/trigger_actions/{id}');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/multiple/trigger_actions/{id}');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/multiple/trigger_actions/{id}")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/multiple/trigger_actions/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/multiple/trigger_actions/{id}\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/multiple/trigger_actions/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/multiple/trigger_actions/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/multiple/trigger_actions/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/multiple/trigger_actions/{id}");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/multiple/trigger_actions/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/multiple/trigger_actions/{id}' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/multiple/trigger_actions/{id}' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/multiple/trigger_actions/{id}"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/multiple/trigger_actions/{id}" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/multiple/trigger_actions/{id}")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/quick_action/{id}:
    get:
      tags:
        - Quick Action
      summary: Trigger Quick Action by ID
      operationId: getQuickAction
      description: This API is used to trigger Quick Action by ID.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Quick Action which will be viewed.
          example: 2
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  QuickActionID:
                    type: integer
                    description: The ID of the Quick Action.
                    example: 1
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/quick_action/2 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/quick_action/2 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/quick_action/2
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/quick_action/2",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/quick_action/2',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/quick_action/2");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/quick_action/2',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/quick_action/2';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/quick_action/2', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/quick_action/2",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/quick_action/2");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/quick_action/2", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/quick_action/2"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/quick_action/2")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/quick_action/2",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/quick_action/2');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/quick_action/2');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/quick_action/2")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/quick_action/2")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/quick_action/2\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/quick_action/2");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/quick_action/2"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/quick_action/2")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/quick_action/2");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/quick_action/2"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/quick_action/2' -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/quick_action/2' -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/quick_action/2"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/quick_action/2" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/quick_action/2")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/quick_action/alarm_set:
    get:
      tags:
        - Quick Action
      summary: View Trigger Action with Quick Action Enabled
      operationId: getQuickActionalarmSet
      description: >-
        This API is used to fetch Trigger Actions with Quick Action status
        enabled.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  alarm_sets:
                    $ref: '#/components/schemas/TriggerActionResponse'
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/quick_action/alarm_set \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/quick_action/alarm_set \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/quick_action/alarm_set
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/quick_action/alarm_set",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/quick_action/alarm_set',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/quick_action/alarm_set");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/quick_action/alarm_set',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/quick_action/alarm_set';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/quick_action/alarm_set', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/quick_action/alarm_set",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/v2/quick_action/alarm_set");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/quick_action/alarm_set",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/quick_action/alarm_set"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/quick_action/alarm_set")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/quick_action/alarm_set",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/quick_action/alarm_set');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/quick_action/alarm_set');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/quick_action/alarm_set")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/quick_action/alarm_set")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/quick_action/alarm_set\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/quick_action/alarm_set");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/quick_action/alarm_set"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/quick_action/alarm_set")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/quick_action/alarm_set");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/quick_action/alarm_set"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/quick_action/alarm_set' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/quick_action/alarm_set' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/quick_action/alarm_set"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/quick_action/alarm_set" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/quick_action/alarm_set")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/quick_action:
    get:
      tags:
        - Quick Action
      summary: View All Quick Action
      operationId: getAllQuickAction
      description: This API is used to fetch all configured quick actions.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuickActionResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/quick_action \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/quick_action \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/quick_action
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/quick_action",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/quick_action',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/v2/quick_action");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/quick_action',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/quick_action';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/quick_action', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/quick_action",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/v2/quick_action");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/quick_action",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/quick_action"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/quick_action")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/quick_action",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/quick_action');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/v2/quick_action');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/quick_action")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/quick_action")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/quick_action\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/quick_action");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/quick_action"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/quick_action")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/quick_action");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/quick_action"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/quick_action' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/quick_action' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/quick_action"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/quick_action" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/quick_action")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Quick Action
      summary: Save/Update/Delete Quick Action
      operationId: createQuickAction
      description: >-
        This API is used to save/update/delete Quick Action.


        `To CREATE`: Fill in all Quick Action(s) parameter (excluding ID). It is
        possible to create multiple Quick Action in one payload.  

        In the case creating new one while there's existing Quick Action(s), the
        new one doesn't require ID while the existing require it.


        `To DELETE`: Fill in all Quick Action(s) parameter (including ID). Input
        all Quick Action(s) besides the one that will be deleted. To delete all,
        simply send an empty payload.


        `To UPDATE`: Fill in all Quick Action(s) parameter (including ID). Input
        all Quick Action(s) including any which will not be updated.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                QuickActions:
                  type: array
                  required:
                    - name
                    - description
                    - confirm_before_run
                    - operator_level_ids
                    - trigger_action_ids
                    - order_number
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: Quick Action name.
                      description:
                        type: string
                        description: Quick Action description.
                      confirm_before_run:
                        type: string
                        description: Confirmation before run (`Y`=enabled, `N`=disabled).
                      operator_level_ids:
                        type: array
                        items:
                          type: integer
                        description: >-
                          List Operator Level ID(s) which allowed to run the
                          Quick Action.
                      trigger_action_ids:
                        type: array
                        items:
                          type: integer
                        description: >-
                          List Trigger & Action ID(s) which will be executed
                          when Quick Action triggered.
                      order_number:
                        type: integer
                        description: Quick Action order number.
                      id:
                        type: integer
                        description: >-
                          Quick Action's ID. Will be generated after Quick
                          Action created. Required to be filled when update or
                          adding.
              example:
                QuickActions:
                  - name: qa 1
                    description: sfsf
                    confirm_before_run: 'Y'
                    operator_level_ids:
                      - 2
                      - 3
                    trigger_action_ids:
                      - 3
                    order_number: 1
                  - name: qa 2
                    description: dsfsdf
                    confirm_before_run: 'Y'
                    operator_level_ids:
                      - 1
                      - 254
                    trigger_action_ids:
                      - 4
                    order_number: 2
                    id: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/quick_action \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"QuickActions":[{"name":"qa 1","description":"sfsf","confirm_before_run":"Y","operator_level_ids":[2,3],"trigger_action_ids":[3],"order_number":1},{"name":"qa 2","description":"dsfsdf","confirm_before_run":"Y","operator_level_ids":[1,254],"trigger_action_ids":[4],"order_number":2,"id":1}]}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"QuickActions":[{"name":"qa
            1","description":"sfsf","confirm_before_run":"Y","operator_level_ids":[2,3],"trigger_action_ids":[3],"order_number":1},{"name":"qa
            2","description":"dsfsdf","confirm_before_run":"Y","operator_level_ids":[1,254],"trigger_action_ids":[4],"order_number":2,"id":1}]}'
            |  \
              http POST https://{baseurl}/api/v2/quick_action \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"QuickActions":[{"name":"qa 1","description":"sfsf","confirm_before_run":"Y","operator_level_ids":[2,3],"trigger_action_ids":[3],"order_number":1},{"name":"qa 2","description":"dsfsdf","confirm_before_run":"Y","operator_level_ids":[1,254],"trigger_action_ids":[4],"order_number":2,"id":1}]}' \
              --output-document \
              - https://{baseurl}/api/v2/quick_action
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/quick_action",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              QuickActions: [
                {
                  name: 'qa 1',
                  description: 'sfsf',
                  confirm_before_run: 'Y',
                  operator_level_ids: [2, 3],
                  trigger_action_ids: [3],
                  order_number: 1
                },
                {
                  name: 'qa 2',
                  description: 'dsfsdf',
                  confirm_before_run: 'Y',
                  operator_level_ids: [1, 254],
                  trigger_action_ids: [4],
                  order_number: 2,
                  id: 1
                }
              ]
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/quick_action',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                QuickActions: [
                  {
                    name: 'qa 1',
                    description: 'sfsf',
                    confirm_before_run: 'Y',
                    operator_level_ids: [2, 3],
                    trigger_action_ids: [3],
                    order_number: 1
                  },
                  {
                    name: 'qa 2',
                    description: 'dsfsdf',
                    confirm_before_run: 'Y',
                    operator_level_ids: [1, 254],
                    trigger_action_ids: [4],
                    order_number: 2,
                    id: 1
                  }
                ]
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/quick_action");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "QuickActions": [
                {
                  "name": "qa 1",
                  "description": "sfsf",
                  "confirm_before_run": "Y",
                  "operator_level_ids": [
                    2,
                    3
                  ],
                  "trigger_action_ids": [
                    3
                  ],
                  "order_number": 1
                },
                {
                  "name": "qa 2",
                  "description": "dsfsdf",
                  "confirm_before_run": "Y",
                  "operator_level_ids": [
                    1,
                    254
                  ],
                  "trigger_action_ids": [
                    4
                  ],
                  "order_number": 2,
                  "id": 1
                }
              ]
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/quick_action',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                QuickActions: [
                  {
                    name: 'qa 1',
                    description: 'sfsf',
                    confirm_before_run: 'Y',
                    operator_level_ids: [2, 3],
                    trigger_action_ids: [3],
                    order_number: 1
                  },
                  {
                    name: 'qa 2',
                    description: 'dsfsdf',
                    confirm_before_run: 'Y',
                    operator_level_ids: [1, 254],
                    trigger_action_ids: [4],
                    order_number: 2,
                    id: 1
                  }
                ]
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/quick_action';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"QuickActions":[{"name":"qa 1","description":"sfsf","confirm_before_run":"Y","operator_level_ids":[2,3],"trigger_action_ids":[3],"order_number":1},{"name":"qa 2","description":"dsfsdf","confirm_before_run":"Y","operator_level_ids":[1,254],"trigger_action_ids":[4],"order_number":2,"id":1}]}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"QuickActions":[{"name":"qa 1","description":"sfsf","confirm_before_run":"Y","operator_level_ids":[2,3],"trigger_action_ids":[3],"order_number":1},{"name":"qa 2","description":"dsfsdf","confirm_before_run":"Y","operator_level_ids":[1,254],"trigger_action_ids":[4],"order_number":2,"id":1}]}'
            };

            fetch('https://{baseurl}/api/v2/quick_action', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/quick_action",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"QuickActions\":[{\"name\":\"qa 1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa 2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "QuickActions": [
                {
                  "name": "qa 1",
                  "description": "sfsf",
                  "confirm_before_run": "Y",
                  "operator_level_ids": [
                    2,
                    3
                  ],
                  "trigger_action_ids": [
                    3
                  ],
                  "order_number": 1
                },
                {
                  "name": "qa 2",
                  "description": "dsfsdf",
                  "confirm_before_run": "Y",
                  "operator_level_ids": [
                    1,
                    254
                  ],
                  "trigger_action_ids": [
                    4
                  ],
                  "order_number": 2,
                  "id": 1
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/quick_action");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"QuickActions\":[{\"name\":\"qa
            1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa
            2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/quick_action", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/quick_action"


            payload = {"QuickActions": [
                    {
                        "name": "qa 1",
                        "description": "sfsf",
                        "confirm_before_run": "Y",
                        "operator_level_ids": [2, 3],
                        "trigger_action_ids": [3],
                        "order_number": 1
                    },
                    {
                        "name": "qa 2",
                        "description": "dsfsdf",
                        "confirm_before_run": "Y",
                        "operator_level_ids": [1, 254],
                        "trigger_action_ids": [4],
                        "order_number": 2,
                        "id": 1
                    }
                ]}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/quick_action")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"QuickActions\":[{\"name\":\"qa
            1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa
            2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/quick_action",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"QuickActions\":[{\"name\":\"qa 1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa 2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/quick_action');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"QuickActions":[{"name":"qa
            1","description":"sfsf","confirm_before_run":"Y","operator_level_ids":[2,3],"trigger_action_ids":[3],"order_number":1},{"name":"qa
            2","description":"dsfsdf","confirm_before_run":"Y","operator_level_ids":[1,254],"trigger_action_ids":[4],"order_number":2,"id":1}]}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"QuickActions":[{"name":"qa
            1","description":"sfsf","confirm_before_run":"Y","operator_level_ids":[2,3],"trigger_action_ids":[3],"order_number":1},{"name":"qa
            2","description":"dsfsdf","confirm_before_run":"Y","operator_level_ids":[1,254],"trigger_action_ids":[4],"order_number":2,"id":1}]}');


            $request->setRequestUrl('https://{baseurl}/api/v2/quick_action');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"QuickActions\":[{\"name\":\"qa
            1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa
            2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/quick_action")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/quick_action")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"QuickActions\":[{\"name\":\"qa 1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa 2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/quick_action\"\n\n\tpayload := strings.NewReader(\"{\\\"QuickActions\\\":[{\\\"name\\\":\\\"qa 1\\\",\\\"description\\\":\\\"sfsf\\\",\\\"confirm_before_run\\\":\\\"Y\\\",\\\"operator_level_ids\\\":[2,3],\\\"trigger_action_ids\\\":[3],\\\"order_number\\\":1},{\\\"name\\\":\\\"qa 2\\\",\\\"description\\\":\\\"dsfsdf\\\",\\\"confirm_before_run\\\":\\\"Y\\\",\\\"operator_level_ids\\\":[1,254],\\\"trigger_action_ids\\\":[4],\\\"order_number\\\":2,\\\"id\\\":1}]}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/quick_action");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"QuickActions\":[{\"name\":\"qa
            1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa
            2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"QuickActions": @[ @{ @"name": @"qa
            1", @"description": @"sfsf", @"confirm_before_run": @"Y",
            @"operator_level_ids": @[ @2, @3 ], @"trigger_action_ids": @[ @3 ],
            @"order_number": @1 }, @{ @"name": @"qa 2", @"description":
            @"dsfsdf", @"confirm_before_run": @"Y", @"operator_level_ids": @[
            @1, @254 ], @"trigger_action_ids": @[ @4 ], @"order_number": @2,
            @"id": @1 } ] };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/quick_action"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["QuickActions": [
                [
                  "name": "qa 1",
                  "description": "sfsf",
                  "confirm_before_run": "Y",
                  "operator_level_ids": [2, 3],
                  "trigger_action_ids": [3],
                  "order_number": 1
                ],
                [
                  "name": "qa 2",
                  "description": "dsfsdf",
                  "confirm_before_run": "Y",
                  "operator_level_ids": [1, 254],
                  "trigger_action_ids": [4],
                  "order_number": 2,
                  "id": 1
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/quick_action")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/quick_action");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"QuickActions\":[{\"name\":\"qa
            1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa
            2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/quick_action"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"QuickActions\":[{\"name\":\"qa 1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa 2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/quick_action' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"QuickActions":[{"name":"qa
            1","description":"sfsf","confirm_before_run":"Y","operator_level_ids":[2,3],"trigger_action_ids":[3],"order_number":1},{"name":"qa
            2","description":"dsfsdf","confirm_before_run":"Y","operator_level_ids":[1,254],"trigger_action_ids":[4],"order_number":2,"id":1}]}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/quick_action' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"QuickActions":[{"name":"qa
            1","description":"sfsf","confirm_before_run":"Y","operator_level_ids":[2,3],"trigger_action_ids":[3],"order_number":1},{"name":"qa
            2","description":"dsfsdf","confirm_before_run":"Y","operator_level_ids":[1,254],"trigger_action_ids":[4],"order_number":2,"id":1}]}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/quick_action"


            payload <- "{\"QuickActions\":[{\"name\":\"qa
            1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa
            2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/quick_action" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"QuickActions\":[{\"name\":\"qa
            1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa
            2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"QuickActions\":[{\"name\":\"qa
            1\",\"description\":\"sfsf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[2,3],\"trigger_action_ids\":[3],\"order_number\":1},{\"name\":\"qa
            2\",\"description\":\"dsfsdf\",\"confirm_before_run\":\"Y\",\"operator_level_ids\":[1,254],\"trigger_action_ids\":[4],\"order_number\":2,\"id\":1}]}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/quick_action")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/quick_action/permission/{id}:
    get:
      tags:
        - Quick Action
      summary: View All Quick Action by Permission ID
      operationId: getQuickActionpermission
      description: This API is used to fetch Quick Actions by Permission ID.
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: Permission ID of the Quick Action which will be viewed.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuickActionResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/quick_action/permission/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/quick_action/permission/{id} \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/quick_action/permission/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/quick_action/permission/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/quick_action/permission/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/quick_action/permission/{id}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/quick_action/permission/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/quick_action/permission/{id}';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/quick_action/permission/{id}',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/quick_action/permission/{id}",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/quick_action/permission/{id}");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/quick_action/permission/{id}",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/quick_action/permission/{id}"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/quick_action/permission/{id}")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/quick_action/permission/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/quick_action/permission/{id}');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/quick_action/permission/{id}');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/quick_action/permission/{id}")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/quick_action/permission/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/quick_action/permission/{id}\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/quick_action/permission/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/quick_action/permission/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/quick_action/permission/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/quick_action/permission/{id}");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/quick_action/permission/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/quick_action/permission/{id}' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/quick_action/permission/{id}' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/quick_action/permission/{id}"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/quick_action/permission/{id}" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/quick_action/permission/{id}")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/quick_action/{id}:
    get:
      tags:
        - Quick Action
      summary: View Quick Action by ID
      operationId: viewQuickActionById
      description: This API is used to fetch Quick Action information by ID.
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the Quick Action which will be viewed.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuickActionResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or missing required
            parameters.
          content:
            application/json: {}
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
        '404':
          description: Not Found - The requested resource was not found.
          content:
            application/json: {}
        '500':
          description: Internal Server Error - An unexpected error occurred on the server.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/quick_action/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/quick_action/{id} \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/quick_action/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/quick_action/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/quick_action/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/quick_action/{id}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/quick_action/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/quick_action/{id}';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/quick_action/{id}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/quick_action/{id}",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/v2/quick_action/{id}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/quick_action/{id}",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/quick_action/{id}"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/quick_action/{id}")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/quick_action/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/quick_action/{id}');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/quick_action/{id}');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/quick_action/{id}")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/quick_action/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/quick_action/{id}\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/quick_action/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/quick_action/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/quick_action/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/quick_action/{id}");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/quick_action/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/quick_action/{id}' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/quick_action/{id}' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/quick_action/{id}"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/quick_action/{id}"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/quick_action/{id}")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/adserverconnect:
    post:
      tags:
        - Active Directory
      summary: Check Active Directory Connection
      operationId: createAdserverconnect
      description: >-
        This API is used to test BioStar X connection with Windows Active
        Directory.


        Successful connection will return `code : 0`.


        See these articles for more information on connecting BioStar X with
        Active Directory:

        -
        [https://support.supremainc.com/en/support/solutions/articles/24000044140](https://support.supremainc.com/en/support/solutions/articles/24000044140)

        -
        [https://support.supremainc.com/en/support/solutions/articles/24000041940--biostar-2-how-to-confirm-active-directory-information/en](https://support.supremainc.com/en/support/solutions/articles/24000041940--biostar-2-how-to-confirm-active-directory-information/en)
      requestBody:
        required: true
        description: Active Directory or Entra ID connection configuration parameters
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ADServerConnect'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/setting/adserverconnect \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
            |  \
              http POST https://{baseurl}/api/v2/setting/adserverconnect \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}' \
              --output-document \
              - https://{baseurl}/api/v2/setting/adserverconnect
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/adserverconnect",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              serverAddress: '',
              userName: '3323232-1111-33b6-a0a0-dfeq6bc7a762',
              password: 'asdfasdfas~!2sdfsdfasdf',
              userDomainName: 'test.onmicrosoft.com',
              useSSL: false,
              adlogin: false,
              RedirectionUri: 'https://127.0.0.1/api/v2/entraid/auth',
              adEnable: '0',
              adType: 'E',
              prevAdType: 'E',
              prevDomainName: 'test.onmicrosoft.com',
              prevServerAddr: '',
              resetSync: false,
              scheduleSyncInterval: 0,
              syncEvtCheck: false,
              syncType: 'N',
              useCustomField: true
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/adserverconnect',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                serverAddress: '',
                userName: '3323232-1111-33b6-a0a0-dfeq6bc7a762',
                password: 'asdfasdfas~!2sdfsdfasdf',
                userDomainName: 'test.onmicrosoft.com',
                useSSL: false,
                adlogin: false,
                RedirectionUri: 'https://127.0.0.1/api/v2/entraid/auth',
                adEnable: '0',
                adType: 'E',
                prevAdType: 'E',
                prevDomainName: 'test.onmicrosoft.com',
                prevServerAddr: '',
                resetSync: false,
                scheduleSyncInterval: 0,
                syncEvtCheck: false,
                syncType: 'N',
                useCustomField: true
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/setting/adserverconnect");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "serverAddress": "",
              "userName": "3323232-1111-33b6-a0a0-dfeq6bc7a762",
              "password": "asdfasdfas~!2sdfsdfasdf",
              "userDomainName": "test.onmicrosoft.com",
              "useSSL": false,
              "adlogin": false,
              "RedirectionUri": "https://127.0.0.1/api/v2/entraid/auth",
              "adEnable": "0",
              "adType": "E",
              "prevAdType": "E",
              "prevDomainName": "test.onmicrosoft.com",
              "prevServerAddr": "",
              "resetSync": false,
              "scheduleSyncInterval": 0,
              "syncEvtCheck": false,
              "syncType": "N",
              "useCustomField": true
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/adserverconnect',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                serverAddress: '',
                userName: '3323232-1111-33b6-a0a0-dfeq6bc7a762',
                password: 'asdfasdfas~!2sdfsdfasdf',
                userDomainName: 'test.onmicrosoft.com',
                useSSL: false,
                adlogin: false,
                RedirectionUri: 'https://127.0.0.1/api/v2/entraid/auth',
                adEnable: '0',
                adType: 'E',
                prevAdType: 'E',
                prevDomainName: 'test.onmicrosoft.com',
                prevServerAddr: '',
                resetSync: false,
                scheduleSyncInterval: 0,
                syncEvtCheck: false,
                syncType: 'N',
                useCustomField: true
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/setting/adserverconnect';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
            };

            fetch('https://{baseurl}/api/v2/setting/adserverconnect', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/adserverconnect",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "serverAddress": "",
              "userName": "3323232-1111-33b6-a0a0-dfeq6bc7a762",
              "password": "asdfasdfas~!2sdfsdfasdf",
              "userDomainName": "test.onmicrosoft.com",
              "useSSL": false,
              "adlogin": false,
              "RedirectionUri": "https://127.0.0.1/api/v2/entraid/auth",
              "adEnable": "0",
              "adType": "E",
              "prevAdType": "E",
              "prevDomainName": "test.onmicrosoft.com",
              "prevServerAddr": "",
              "resetSync": false,
              "scheduleSyncInterval": 0,
              "syncEvtCheck": false,
              "syncType": "N",
              "useCustomField": true
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/v2/setting/adserverconnect");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/setting/adserverconnect",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/setting/adserverconnect"


            payload = {
                "serverAddress": "",
                "userName": "3323232-1111-33b6-a0a0-dfeq6bc7a762",
                "password": "asdfasdfas~!2sdfsdfasdf",
                "userDomainName": "test.onmicrosoft.com",
                "useSSL": False,
                "adlogin": False,
                "RedirectionUri": "https://127.0.0.1/api/v2/entraid/auth",
                "adEnable": "0",
                "adType": "E",
                "prevAdType": "E",
                "prevDomainName": "test.onmicrosoft.com",
                "prevServerAddr": "",
                "resetSync": False,
                "scheduleSyncInterval": 0,
                "syncEvtCheck": False,
                "syncType": "N",
                "useCustomField": True
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/setting/adserverconnect")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/adserverconnect",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/adserverconnect');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}');


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/adserverconnect');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adserverconnect")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/setting/adserverconnect")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/adserverconnect\"\n\n\tpayload := strings.NewReader(\"{\\\"serverAddress\\\":\\\"\\\",\\\"userName\\\":\\\"3323232-1111-33b6-a0a0-dfeq6bc7a762\\\",\\\"password\\\":\\\"asdfasdfas~!2sdfsdfasdf\\\",\\\"userDomainName\\\":\\\"test.onmicrosoft.com\\\",\\\"useSSL\\\":false,\\\"adlogin\\\":false,\\\"RedirectionUri\\\":\\\"https://127.0.0.1/api/v2/entraid/auth\\\",\\\"adEnable\\\":\\\"0\\\",\\\"adType\\\":\\\"E\\\",\\\"prevAdType\\\":\\\"E\\\",\\\"prevDomainName\\\":\\\"test.onmicrosoft.com\\\",\\\"prevServerAddr\\\":\\\"\\\",\\\"resetSync\\\":false,\\\"scheduleSyncInterval\\\":0,\\\"syncEvtCheck\\\":false,\\\"syncType\\\":\\\"N\\\",\\\"useCustomField\\\":true}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/adserverconnect");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"serverAddress": @"",
                                          @"userName": @"3323232-1111-33b6-a0a0-dfeq6bc7a762",
                                          @"password": @"asdfasdfas~!2sdfsdfasdf",
                                          @"userDomainName": @"test.onmicrosoft.com",
                                          @"useSSL": @NO,
                                          @"adlogin": @NO,
                                          @"RedirectionUri": @"https://127.0.0.1/api/v2/entraid/auth",
                                          @"adEnable": @"0",
                                          @"adType": @"E",
                                          @"prevAdType": @"E",
                                          @"prevDomainName": @"test.onmicrosoft.com",
                                          @"prevServerAddr": @"",
                                          @"resetSync": @NO,
                                          @"scheduleSyncInterval": @0,
                                          @"syncEvtCheck": @NO,
                                          @"syncType": @"N",
                                          @"useCustomField": @YES };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/adserverconnect"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "serverAddress": "",
              "userName": "3323232-1111-33b6-a0a0-dfeq6bc7a762",
              "password": "asdfasdfas~!2sdfsdfasdf",
              "userDomainName": "test.onmicrosoft.com",
              "useSSL": false,
              "adlogin": false,
              "RedirectionUri": "https://127.0.0.1/api/v2/entraid/auth",
              "adEnable": "0",
              "adType": "E",
              "prevAdType": "E",
              "prevDomainName": "test.onmicrosoft.com",
              "prevServerAddr": "",
              "resetSync": false,
              "scheduleSyncInterval": 0,
              "syncEvtCheck": false,
              "syncType": "N",
              "useCustomField": true
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/adserverconnect")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/adserverconnect");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/adserverconnect"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/adserverconnect' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/adserverconnect' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/adserverconnect"


            payload <-
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/adserverconnect" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adserverconnect")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/adUserGroupList:
    post:
      tags:
        - Active Directory
      summary: User Group Search
      operationId: createAdusergrouplist
      description: >-
        To run BioStar X AD APIs, it is required to be connected to the AD
        server.


        This API is used to get User Group information from the Domain
        Controller.


        It is required to put domain name information on the body.


        The response value is returned in JSON format. At this time,
        `Collection.rows.userGroups` is used for the next user group update.
      requestBody:
        content:
          application/json:
            schema:
              type: string
              example: DC=domain,DC=com
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/setting/adUserGroupList \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '"DC=domain,DC=com"'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '"DC=domain,DC=com"' |  \
              http POST https://{baseurl}/api/v2/setting/adUserGroupList \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '"DC=domain,DC=com"' \
              --output-document \
              - https://{baseurl}/api/v2/setting/adUserGroupList
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/adUserGroupList",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify('DC=domain,DC=com'));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/adUserGroupList',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: 'DC=domain,DC=com',
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/setting/adUserGroupList");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send("DC=domain,DC=com");


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/adUserGroupList',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: 'DC=domain,DC=com'
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/setting/adUserGroupList';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '"DC=domain,DC=com"'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '"DC=domain,DC=com"'
            };

            fetch('https://{baseurl}/api/v2/setting/adUserGroupList', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/adUserGroupList",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "\"DC=domain,DC=com\""
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify("DC=domain,DC=com");


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/v2/setting/adUserGroupList");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "\"DC=domain,DC=com\""


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/setting/adUserGroupList",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/setting/adUserGroupList"


            payload = "DC=domain,DC=com"

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/setting/adUserGroupList")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "\"DC=domain,DC=com\""

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/adUserGroupList",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "\"DC=domain,DC=com\"",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/adUserGroupList');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('"DC=domain,DC=com"');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('"DC=domain,DC=com"');


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/adUserGroupList');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "\"DC=domain,DC=com\"");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adUserGroupList")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/setting/adUserGroupList")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("\"DC=domain,DC=com\"")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/adUserGroupList\"\n\n\tpayload := strings.NewReader(\"\\\"DC=domain,DC=com\\\"\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/adUserGroupList");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "\"DC=domain,DC=com\"");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @"DC=domain,DC=com";


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/adUserGroupList"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = "DC=domain,DC=com" as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/adUserGroupList")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/adUserGroupList");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json", "\"DC=domain,DC=com\"",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/adUserGroupList"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("\"DC=domain,DC=com\"")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/adUserGroupList' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '"DC=domain,DC=com"'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/adUserGroupList' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '"DC=domain,DC=com"'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/adUserGroupList"


            payload <- "\"DC=domain,DC=com\""


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/adUserGroupList" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string "\"DC=domain,DC=com\"" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val mediaType = MediaType.parse("application/json")
            val body = RequestBody.create(mediaType, "\"DC=domain,DC=com\"")
            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adUserGroupList")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/adUserGroupFilterSetting:
    post:
      tags:
        - Active Directory
      summary: User Group Update
      operationId: createAdusergroupfiltersetting
      description: >-
        Based on the user group information queried in User Group Search, the
        user group which will be linked is updated.


        Update the user group and save it to the Biostar X server.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - allUserGroup
                - dn
                - lastSyncVersion
                - userGroups
                - userGroupFilters
              properties:
                allUserGroup:
                  type: boolean
                  description: Toggle True when selecting all User Groups.
                dn:
                  type: string
                  description: Domain Name
                lastSyncVersion:
                  type: integer
                  description: Set to 0
                userGroups:
                  type: array
                  description: Put `Collection.rows.userGroups` from User Group Search
                  items:
                    type: object
                userGroupFilters:
                  type: array
                  description: >-
                    Place the id and name of the user groups to be synchronized
                    into an array.
                  items:
                    type: object
              example:
                allUserGroup: true
                dn: DC=domain,DC=com
                lastSyncVersion: 0
                userGroups:
                  - id: 0
                    dn: oddtest.id
                    name: oddtest.id
                    objectGuid: oddtest.id
                    children:
                      - id: 1
                        dn: OU=Domain Controllers,DC=oddtest,DC=id
                        name: Domain Controllers
                        objectGuid: 0921243F0254453F3F3F72273F4F7C
                        children: []
                        isGroup: true
                    isGroup: true
                userGroupFilters:
                  - id: 10
                    name: Guests
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/setting/adUserGroupFilterSetting \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"allUserGroup":true,"dn":"DC=domain,DC=com","lastSyncVersion":0,"userGroups":[{"id":0,"dn":"oddtest.id","name":"oddtest.id","objectGuid":"oddtest.id","children":[{"id":1,"dn":"OU=Domain Controllers,DC=oddtest,DC=id","name":"Domain Controllers","objectGuid":"0921243F0254453F3F3F72273F4F7C","children":[],"isGroup":true}],"isGroup":true}],"userGroupFilters":[{"id":10,"name":"Guests"}]}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"allUserGroup":true,"dn":"DC=domain,DC=com","lastSyncVersion":0,"userGroups":[{"id":0,"dn":"oddtest.id","name":"oddtest.id","objectGuid":"oddtest.id","children":[{"id":1,"dn":"OU=Domain
            Controllers,DC=oddtest,DC=id","name":"Domain
            Controllers","objectGuid":"0921243F0254453F3F3F72273F4F7C","children":[],"isGroup":true}],"isGroup":true}],"userGroupFilters":[{"id":10,"name":"Guests"}]}'
            |  \
              http POST https://{baseurl}/api/v2/setting/adUserGroupFilterSetting \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"allUserGroup":true,"dn":"DC=domain,DC=com","lastSyncVersion":0,"userGroups":[{"id":0,"dn":"oddtest.id","name":"oddtest.id","objectGuid":"oddtest.id","children":[{"id":1,"dn":"OU=Domain Controllers,DC=oddtest,DC=id","name":"Domain Controllers","objectGuid":"0921243F0254453F3F3F72273F4F7C","children":[],"isGroup":true}],"isGroup":true}],"userGroupFilters":[{"id":10,"name":"Guests"}]}' \
              --output-document \
              - https://{baseurl}/api/v2/setting/adUserGroupFilterSetting
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/adUserGroupFilterSetting",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              allUserGroup: true,
              dn: 'DC=domain,DC=com',
              lastSyncVersion: 0,
              userGroups: [
                {
                  id: 0,
                  dn: 'oddtest.id',
                  name: 'oddtest.id',
                  objectGuid: 'oddtest.id',
                  children: [
                    {
                      id: 1,
                      dn: 'OU=Domain Controllers,DC=oddtest,DC=id',
                      name: 'Domain Controllers',
                      objectGuid: '0921243F0254453F3F3F72273F4F7C',
                      children: [],
                      isGroup: true
                    }
                  ],
                  isGroup: true
                }
              ],
              userGroupFilters: [{id: 10, name: 'Guests'}]
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/adUserGroupFilterSetting',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                allUserGroup: true,
                dn: 'DC=domain,DC=com',
                lastSyncVersion: 0,
                userGroups: [
                  {
                    id: 0,
                    dn: 'oddtest.id',
                    name: 'oddtest.id',
                    objectGuid: 'oddtest.id',
                    children: [
                      {
                        id: 1,
                        dn: 'OU=Domain Controllers,DC=oddtest,DC=id',
                        name: 'Domain Controllers',
                        objectGuid: '0921243F0254453F3F3F72273F4F7C',
                        children: [],
                        isGroup: true
                      }
                    ],
                    isGroup: true
                  }
                ],
                userGroupFilters: [{id: 10, name: 'Guests'}]
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "allUserGroup": true,
              "dn": "DC=domain,DC=com",
              "lastSyncVersion": 0,
              "userGroups": [
                {
                  "id": 0,
                  "dn": "oddtest.id",
                  "name": "oddtest.id",
                  "objectGuid": "oddtest.id",
                  "children": [
                    {
                      "id": 1,
                      "dn": "OU=Domain Controllers,DC=oddtest,DC=id",
                      "name": "Domain Controllers",
                      "objectGuid": "0921243F0254453F3F3F72273F4F7C",
                      "children": [],
                      "isGroup": true
                    }
                  ],
                  "isGroup": true
                }
              ],
              "userGroupFilters": [
                {
                  "id": 10,
                  "name": "Guests"
                }
              ]
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/adUserGroupFilterSetting',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                allUserGroup: true,
                dn: 'DC=domain,DC=com',
                lastSyncVersion: 0,
                userGroups: [
                  {
                    id: 0,
                    dn: 'oddtest.id',
                    name: 'oddtest.id',
                    objectGuid: 'oddtest.id',
                    children: [
                      {
                        id: 1,
                        dn: 'OU=Domain Controllers,DC=oddtest,DC=id',
                        name: 'Domain Controllers',
                        objectGuid: '0921243F0254453F3F3F72273F4F7C',
                        children: [],
                        isGroup: true
                      }
                    ],
                    isGroup: true
                  }
                ],
                userGroupFilters: [{id: 10, name: 'Guests'}]
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/setting/adUserGroupFilterSetting';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"allUserGroup":true,"dn":"DC=domain,DC=com","lastSyncVersion":0,"userGroups":[{"id":0,"dn":"oddtest.id","name":"oddtest.id","objectGuid":"oddtest.id","children":[{"id":1,"dn":"OU=Domain Controllers,DC=oddtest,DC=id","name":"Domain Controllers","objectGuid":"0921243F0254453F3F3F72273F4F7C","children":[],"isGroup":true}],"isGroup":true}],"userGroupFilters":[{"id":10,"name":"Guests"}]}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"allUserGroup":true,"dn":"DC=domain,DC=com","lastSyncVersion":0,"userGroups":[{"id":0,"dn":"oddtest.id","name":"oddtest.id","objectGuid":"oddtest.id","children":[{"id":1,"dn":"OU=Domain Controllers,DC=oddtest,DC=id","name":"Domain Controllers","objectGuid":"0921243F0254453F3F3F72273F4F7C","children":[],"isGroup":true}],"isGroup":true}],"userGroupFilters":[{"id":10,"name":"Guests"}]}'
            };


            fetch('https://{baseurl}/api/v2/setting/adUserGroupFilterSetting',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain Controllers,DC=oddtest,DC=id\",\"name\":\"Domain Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "allUserGroup": true,
              "dn": "DC=domain,DC=com",
              "lastSyncVersion": 0,
              "userGroups": [
                {
                  "id": 0,
                  "dn": "oddtest.id",
                  "name": "oddtest.id",
                  "objectGuid": "oddtest.id",
                  "children": [
                    {
                      "id": 1,
                      "dn": "OU=Domain Controllers,DC=oddtest,DC=id",
                      "name": "Domain Controllers",
                      "objectGuid": "0921243F0254453F3F3F72273F4F7C",
                      "children": [],
                      "isGroup": true
                    }
                  ],
                  "isGroup": true
                }
              ],
              "userGroupFilters": [
                {
                  "id": 10,
                  "name": "Guests"
                }
              ]
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain
            Controllers,DC=oddtest,DC=id\",\"name\":\"Domain
            Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/v2/setting/adUserGroupFilterSetting", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting"


            payload = {
                "allUserGroup": True,
                "dn": "DC=domain,DC=com",
                "lastSyncVersion": 0,
                "userGroups": [
                    {
                        "id": 0,
                        "dn": "oddtest.id",
                        "name": "oddtest.id",
                        "objectGuid": "oddtest.id",
                        "children": [
                            {
                                "id": 1,
                                "dn": "OU=Domain Controllers,DC=oddtest,DC=id",
                                "name": "Domain Controllers",
                                "objectGuid": "0921243F0254453F3F3F72273F4F7C",
                                "children": [],
                                "isGroup": True
                            }
                        ],
                        "isGroup": True
                    }
                ],
                "userGroupFilters": [
                    {
                        "id": 10,
                        "name": "Guests"
                    }
                ]
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain
            Controllers,DC=oddtest,DC=id\",\"name\":\"Domain
            Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain Controllers,DC=oddtest,DC=id\",\"name\":\"Domain Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/adUserGroupFilterSetting');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"allUserGroup":true,"dn":"DC=domain,DC=com","lastSyncVersion":0,"userGroups":[{"id":0,"dn":"oddtest.id","name":"oddtest.id","objectGuid":"oddtest.id","children":[{"id":1,"dn":"OU=Domain
            Controllers,DC=oddtest,DC=id","name":"Domain
            Controllers","objectGuid":"0921243F0254453F3F3F72273F4F7C","children":[],"isGroup":true}],"isGroup":true}],"userGroupFilters":[{"id":10,"name":"Guests"}]}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"allUserGroup":true,"dn":"DC=domain,DC=com","lastSyncVersion":0,"userGroups":[{"id":0,"dn":"oddtest.id","name":"oddtest.id","objectGuid":"oddtest.id","children":[{"id":1,"dn":"OU=Domain
            Controllers,DC=oddtest,DC=id","name":"Domain
            Controllers","objectGuid":"0921243F0254453F3F3F72273F4F7C","children":[],"isGroup":true}],"isGroup":true}],"userGroupFilters":[{"id":10,"name":"Guests"}]}');


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/adUserGroupFilterSetting');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain
            Controllers,DC=oddtest,DC=id\",\"name\":\"Domain
            Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain Controllers,DC=oddtest,DC=id\",\"name\":\"Domain Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/adUserGroupFilterSetting\"\n\n\tpayload := strings.NewReader(\"{\\\"allUserGroup\\\":true,\\\"dn\\\":\\\"DC=domain,DC=com\\\",\\\"lastSyncVersion\\\":0,\\\"userGroups\\\":[{\\\"id\\\":0,\\\"dn\\\":\\\"oddtest.id\\\",\\\"name\\\":\\\"oddtest.id\\\",\\\"objectGuid\\\":\\\"oddtest.id\\\",\\\"children\\\":[{\\\"id\\\":1,\\\"dn\\\":\\\"OU=Domain Controllers,DC=oddtest,DC=id\\\",\\\"name\\\":\\\"Domain Controllers\\\",\\\"objectGuid\\\":\\\"0921243F0254453F3F3F72273F4F7C\\\",\\\"children\\\":[],\\\"isGroup\\\":true}],\\\"isGroup\\\":true}],\\\"userGroupFilters\\\":[{\\\"id\\\":10,\\\"name\\\":\\\"Guests\\\"}]}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain
            Controllers,DC=oddtest,DC=id\",\"name\":\"Domain
            Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"allUserGroup": @YES,
                                          @"dn": @"DC=domain,DC=com",
                                          @"lastSyncVersion": @0,
                                          @"userGroups": @[ @{ @"id": @0, @"dn": @"oddtest.id", @"name": @"oddtest.id", @"objectGuid": @"oddtest.id", @"children": @[ @{ @"id": @1, @"dn": @"OU=Domain Controllers,DC=oddtest,DC=id", @"name": @"Domain Controllers", @"objectGuid": @"0921243F0254453F3F3F72273F4F7C", @"children": @[  ], @"isGroup": @YES } ], @"isGroup": @YES } ],
                                          @"userGroupFilters": @[ @{ @"id": @10, @"name": @"Guests" } ] };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/adUserGroupFilterSetting"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "allUserGroup": true,
              "dn": "DC=domain,DC=com",
              "lastSyncVersion": 0,
              "userGroups": [
                [
                  "id": 0,
                  "dn": "oddtest.id",
                  "name": "oddtest.id",
                  "objectGuid": "oddtest.id",
                  "children": [
                    [
                      "id": 1,
                      "dn": "OU=Domain Controllers,DC=oddtest,DC=id",
                      "name": "Domain Controllers",
                      "objectGuid": "0921243F0254453F3F3F72273F4F7C",
                      "children": [],
                      "isGroup": true
                    ]
                  ],
                  "isGroup": true
                ]
              ],
              "userGroupFilters": [
                [
                  "id": 10,
                  "name": "Guests"
                ]
              ]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain
            Controllers,DC=oddtest,DC=id\",\"name\":\"Domain
            Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain Controllers,DC=oddtest,DC=id\",\"name\":\"Domain Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/adUserGroupFilterSetting' -Method
            POST -Headers $headers -ContentType 'application/json' -Body
            '{"allUserGroup":true,"dn":"DC=domain,DC=com","lastSyncVersion":0,"userGroups":[{"id":0,"dn":"oddtest.id","name":"oddtest.id","objectGuid":"oddtest.id","children":[{"id":1,"dn":"OU=Domain
            Controllers,DC=oddtest,DC=id","name":"Domain
            Controllers","objectGuid":"0921243F0254453F3F3F72273F4F7C","children":[],"isGroup":true}],"isGroup":true}],"userGroupFilters":[{"id":10,"name":"Guests"}]}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/adUserGroupFilterSetting' -Method
            POST -Headers $headers -ContentType 'application/json' -Body
            '{"allUserGroup":true,"dn":"DC=domain,DC=com","lastSyncVersion":0,"userGroups":[{"id":0,"dn":"oddtest.id","name":"oddtest.id","objectGuid":"oddtest.id","children":[{"id":1,"dn":"OU=Domain
            Controllers,DC=oddtest,DC=id","name":"Domain
            Controllers","objectGuid":"0921243F0254453F3F3F72273F4F7C","children":[],"isGroup":true}],"isGroup":true}],"userGroupFilters":[{"id":10,"name":"Guests"}]}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting"


            payload <-
            "{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain
            Controllers,DC=oddtest,DC=id\",\"name\":\"Domain
            Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain
            Controllers,DC=oddtest,DC=id\",\"name\":\"Domain
            Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"allUserGroup\":true,\"dn\":\"DC=domain,DC=com\",\"lastSyncVersion\":0,\"userGroups\":[{\"id\":0,\"dn\":\"oddtest.id\",\"name\":\"oddtest.id\",\"objectGuid\":\"oddtest.id\",\"children\":[{\"id\":1,\"dn\":\"OU=Domain
            Controllers,DC=oddtest,DC=id\",\"name\":\"Domain
            Controllers\",\"objectGuid\":\"0921243F0254453F3F3F72273F4F7C\",\"children\":[],\"isGroup\":true}],\"isGroup\":true}],\"userGroupFilters\":[{\"id\":10,\"name\":\"Guests\"}]}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Active Directory
      summary: View AD User Group Filter List
      operationId: getAdusergroupfiltersetting
      description: >-
        View group information, subgroup information and filter information that
        Active Directory or EntraID is using.
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              example:
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: success
                  by: web
                Collection:
                  total: 1
                  rows:
                    - allUserGroup: false
                      dn: supremabss.onmicrosoft.com
                      lastSyncVersion: 0
                      userGroups:
                        - id: 0
                          dn: supremabss.onmicrosoft.com
                          name: supremabss.onmicrosoft.com
                          objectGuid: supremabss.onmicrosoft.com
                          filter: false
                          children:
                            - id: 1
                              dn: OU=A,DC=supremabss.onmicrosoft.com
                              name: A
                              objectGuid: e1dd535c-76ce-4181-9f3b-869eea61b0b1
                              filter: true
                              children:
                                - id: 2
                                  dn: OU=B,OU=A,DC=supremabss.onmicrosoft.com
                                  name: B
                                  objectGuid: 9745e0df-1723-4c42-8ea5-febb02865f28
                                  filter: true
                                  children:
                                    - id: 3
                                      dn: >-
                                        OU=C,OU=B,OU=A,DC=supremabss.onmicrosoft.com
                                      name: C
                                      objectGuid: 8754dd0a-d1a6-455d-8ffc-04357322ff1e
                                      filter: true
                                      children: []
                                      depth: 3
                                      isGroup: true
                                  depth: 2
                                  isGroup: true
                              depth: 1
                              isGroup: true
                            - id: 4
                              dn: OU=Test3,DC=supremabss.onmicrosoft.com
                              name: Test3
                              objectGuid: 77952318-d550-4616-b516-6a65c3f44b57
                              filter: true
                              children: []
                              depth: 1
                              isGroup: true
                            - id: 5
                              dn: OU=Test4,DC=supremabss.onmicrosoft.com
                              name: Test4
                              objectGuid: cffad5c5-afe5-4029-a44e-4f67ba96baf9
                              filter: true
                              children: []
                              depth: 1
                              isGroup: true
                            - id: 6
                              dn: OU=Test9,DC=supremabss.onmicrosoft.com
                              name: Test9
                              objectGuid: ea407a19-c769-4db5-b4f6-c8e2ba28fc70
                              filter: true
                              children: []
                              depth: 1
                              isGroup: true
                          depth: 0
                          isGroup: true
                      userGroupFilters:
                        - id: 1
                          dn: OU=A,DC=supremabss.onmicrosoft.com
                          name: A
                          objectGuid: e1dd535c-76ce-4181-9f3b-869eea61b0b1
                          filter: true
                          children:
                            - id: 2
                              dn: OU=B,OU=A,DC=supremabss.onmicrosoft.com
                              name: B
                              objectGuid: 9745e0df-1723-4c42-8ea5-febb02865f28
                              filter: true
                              children:
                                - id: 3
                                  dn: OU=C,OU=B,OU=A,DC=supremabss.onmicrosoft.com
                                  name: C
                                  objectGuid: 8754dd0a-d1a6-455d-8ffc-04357322ff1e
                                  filter: true
                                  children: []
                                  depth: 3
                                  isGroup: true
                              depth: 2
                              isGroup: true
                          depth: 1
                          isGroup: true
                        - id: 2
                          dn: OU=B,OU=A,DC=supremabss.onmicrosoft.com
                          name: B
                          objectGuid: 9745e0df-1723-4c42-8ea5-febb02865f28
                          filter: true
                          children:
                            - id: 3
                              dn: OU=C,OU=B,OU=A,DC=supremabss.onmicrosoft.com
                              name: C
                              objectGuid: 8754dd0a-d1a6-455d-8ffc-04357322ff1e
                              filter: true
                              children: []
                              depth: 3
                              isGroup: true
                          depth: 2
                          isGroup: true
                        - id: 3
                          dn: OU=C,OU=B,OU=A,DC=supremabss.onmicrosoft.com
                          name: C
                          objectGuid: 8754dd0a-d1a6-455d-8ffc-04357322ff1e
                          filter: true
                          children: []
                          depth: 3
                          isGroup: true
                        - id: 4
                          dn: OU=Test3,DC=supremabss.onmicrosoft.com
                          name: Test3
                          objectGuid: 77952318-d550-4616-b516-6a65c3f44b57
                          filter: true
                          children: []
                          depth: 1
                          isGroup: true
                        - id: 5
                          dn: OU=Test4,DC=supremabss.onmicrosoft.com
                          name: Test4
                          objectGuid: cffad5c5-afe5-4029-a44e-4f67ba96baf9
                          filter: true
                          children: []
                          depth: 1
                          isGroup: true
                        - id: 6
                          dn: OU=Test9,DC=supremabss.onmicrosoft.com
                          name: Test9
                          objectGuid: ea407a19-c769-4db5-b4f6-c8e2ba28fc70
                          filter: true
                          children: []
                          depth: 1
                          isGroup: true
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/setting/adUserGroupFilterSetting \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/setting/adUserGroupFilterSetting \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/setting/adUserGroupFilterSetting
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/adUserGroupFilterSetting",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/adUserGroupFilterSetting',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/adUserGroupFilterSetting',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/setting/adUserGroupFilterSetting';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/setting/adUserGroupFilterSetting',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/v2/setting/adUserGroupFilterSetting",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/adUserGroupFilterSetting');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/adUserGroupFilterSetting');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/adUserGroupFilterSetting\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/adUserGroupFilterSetting"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/adUserGroupFilterSetting' -Method
            GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/adUserGroupFilterSetting' -Method
            GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/adUserGroupFilterSetting" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adUserGroupFilterSetting")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/changeadusrmappinglist:
    post:
      tags:
        - Active Directory
      summary: Change AD User Mapping
      operationId: createChangeadusrmappinglist
      description: >-
        This API is used to set the user field configuration.


        The payload is in the form of a JSON array.  

        Each array has BioStar X column name (columnm), AD column name
        (adcolumnm), whether to use (use), and column description
        (columnmdescription).


        > \[ 
          
        >
        {"columnm":"usrid","adcolumnm":"sAMAccountName","use":"true","columnmdescription":"userid"}
        {"columnm":"nm","adcolumnm":"displayName"
        ,"use":"true","columnmdescription":"User NAME"} 
          
        > \] 
          

        If you set the payload as above, you can sync the username as well.
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  columnm:
                    type: string
                    description: BioStar X column name
                  adcolumnm:
                    type: string
                    description: Active Directory column name
                  use:
                    type: string
                    description: Whether to use this mapping
                  columnmdescription:
                    type: string
                    description: Column description
                required:
                  - columnm
                  - adcolumnm
                  - use
                  - columnmdescription
              example:
                - columnm: usrid
                  adcolumnm: initials
                  use: 'true'
                  columnmdescription: User ID
                - columnm: nm
                  adcolumnm: displayName
                  use: 'true'
                  columnmdescription: User Name
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/setting/changeadusrmappinglist \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '[{"columnm":"usrid","adcolumnm":"initials","use":"true","columnmdescription":"User ID"},{"columnm":"nm","adcolumnm":"displayName","use":"true","columnmdescription":"User Name"}]'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '[{"columnm":"usrid","adcolumnm":"initials","use":"true","columnmdescription":"User
            ID"},{"columnm":"nm","adcolumnm":"displayName","use":"true","columnmdescription":"User
            Name"}]' |  \
              http POST https://{baseurl}/api/v2/setting/changeadusrmappinglist \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '[{"columnm":"usrid","adcolumnm":"initials","use":"true","columnmdescription":"User ID"},{"columnm":"nm","adcolumnm":"displayName","use":"true","columnmdescription":"User Name"}]' \
              --output-document \
              - https://{baseurl}/api/v2/setting/changeadusrmappinglist
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/changeadusrmappinglist",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify([
              {
                columnm: 'usrid',
                adcolumnm: 'initials',
                use: 'true',
                columnmdescription: 'User ID'
              },
              {
                columnm: 'nm',
                adcolumnm: 'displayName',
                use: 'true',
                columnmdescription: 'User Name'
              }
            ]));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/changeadusrmappinglist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: [
                {
                  columnm: 'usrid',
                  adcolumnm: 'initials',
                  use: 'true',
                  columnmdescription: 'User ID'
                },
                {
                  columnm: 'nm',
                  adcolumnm: 'displayName',
                  use: 'true',
                  columnmdescription: 'User Name'
                }
              ],
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/setting/changeadusrmappinglist");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send([
              {
                "columnm": "usrid",
                "adcolumnm": "initials",
                "use": "true",
                "columnmdescription": "User ID"
              },
              {
                "columnm": "nm",
                "adcolumnm": "displayName",
                "use": "true",
                "columnmdescription": "User Name"
              }
            ]);


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/changeadusrmappinglist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: [
                {
                  columnm: 'usrid',
                  adcolumnm: 'initials',
                  use: 'true',
                  columnmdescription: 'User ID'
                },
                {
                  columnm: 'nm',
                  adcolumnm: 'displayName',
                  use: 'true',
                  columnmdescription: 'User Name'
                }
              ]
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/setting/changeadusrmappinglist';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '[{"columnm":"usrid","adcolumnm":"initials","use":"true","columnmdescription":"User ID"},{"columnm":"nm","adcolumnm":"displayName","use":"true","columnmdescription":"User Name"}]'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '[{"columnm":"usrid","adcolumnm":"initials","use":"true","columnmdescription":"User ID"},{"columnm":"nm","adcolumnm":"displayName","use":"true","columnmdescription":"User Name"}]'
            };


            fetch('https://{baseurl}/api/v2/setting/changeadusrmappinglist',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/changeadusrmappinglist",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User Name\"}]"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify([
              {
                "columnm": "usrid",
                "adcolumnm": "initials",
                "use": "true",
                "columnmdescription": "User ID"
              },
              {
                "columnm": "nm",
                "adcolumnm": "displayName",
                "use": "true",
                "columnmdescription": "User Name"
              }
            ]);


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/v2/setting/changeadusrmappinglist");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User
            ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User
            Name\"}]"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/v2/setting/changeadusrmappinglist", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/setting/changeadusrmappinglist"


            payload = [
                {
                    "columnm": "usrid",
                    "adcolumnm": "initials",
                    "use": "true",
                    "columnmdescription": "User ID"
                },
                {
                    "columnm": "nm",
                    "adcolumnm": "displayName",
                    "use": "true",
                    "columnmdescription": "User Name"
                }
            ]

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/setting/changeadusrmappinglist")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User
            ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User
            Name\"}]"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/changeadusrmappinglist",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User Name\"}]",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/changeadusrmappinglist');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('[{"columnm":"usrid","adcolumnm":"initials","use":"true","columnmdescription":"User
            ID"},{"columnm":"nm","adcolumnm":"displayName","use":"true","columnmdescription":"User
            Name"}]');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('[{"columnm":"usrid","adcolumnm":"initials","use":"true","columnmdescription":"User
            ID"},{"columnm":"nm","adcolumnm":"displayName","use":"true","columnmdescription":"User
            Name"}]');


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/changeadusrmappinglist');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User
            ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User
            Name\"}]");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/changeadusrmappinglist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/setting/changeadusrmappinglist")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User Name\"}]")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/changeadusrmappinglist\"\n\n\tpayload := strings.NewReader(\"[{\\\"columnm\\\":\\\"usrid\\\",\\\"adcolumnm\\\":\\\"initials\\\",\\\"use\\\":\\\"true\\\",\\\"columnmdescription\\\":\\\"User ID\\\"},{\\\"columnm\\\":\\\"nm\\\",\\\"adcolumnm\\\":\\\"displayName\\\",\\\"use\\\":\\\"true\\\",\\\"columnmdescription\\\":\\\"User Name\\\"}]\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/changeadusrmappinglist");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User
            ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User
            Name\"}]");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @[ @{ @"columnm": @"usrid", @"adcolumnm":
            @"initials", @"use": @"true", @"columnmdescription": @"User ID" },
                                          @{ @"columnm": @"nm", @"adcolumnm": @"displayName", @"use": @"true", @"columnmdescription": @"User Name" } ];

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/changeadusrmappinglist"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              [
                "columnm": "usrid",
                "adcolumnm": "initials",
                "use": "true",
                "columnmdescription": "User ID"
              ],
              [
                "columnm": "nm",
                "adcolumnm": "displayName",
                "use": "true",
                "columnmdescription": "User Name"
              ]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/changeadusrmappinglist")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/changeadusrmappinglist");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User
            ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User
            Name\"}]", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/changeadusrmappinglist"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User Name\"}]")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/changeadusrmappinglist' -Method
            POST -Headers $headers -ContentType 'application/json' -Body
            '[{"columnm":"usrid","adcolumnm":"initials","use":"true","columnmdescription":"User
            ID"},{"columnm":"nm","adcolumnm":"displayName","use":"true","columnmdescription":"User
            Name"}]'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/changeadusrmappinglist' -Method
            POST -Headers $headers -ContentType 'application/json' -Body
            '[{"columnm":"usrid","adcolumnm":"initials","use":"true","columnmdescription":"User
            ID"},{"columnm":"nm","adcolumnm":"displayName","use":"true","columnmdescription":"User
            Name"}]'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/changeadusrmappinglist"


            payload <-
            "[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User
            ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User
            Name\"}]"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/changeadusrmappinglist" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User
            ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User
            Name\"}]" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "[{\"columnm\":\"usrid\",\"adcolumnm\":\"initials\",\"use\":\"true\",\"columnmdescription\":\"User
            ID\"},{\"columnm\":\"nm\",\"adcolumnm\":\"displayName\",\"use\":\"true\",\"columnmdescription\":\"User
            Name\"}]")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/changeadusrmappinglist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/syncadserver:
    post:
      tags:
        - Active Directory
      summary: Synchronize
      operationId: createSyncadserver
      description: >-
        This API is used to synchronizes AD user information with Biostar X.


        If there is no user group change or field reorganization then only this
        synchronization operation is sufficient.


        serverAddress, userName, password, userDomainName, and useSSL must be
        sent in the payload.


        lastSyncTime, lastSyncResult, lastUpdateTime fields on response are
        "recent sync time with ad server", "recent sync result", "recent update
        time of ad server information",  

        It can be checked through `GET /api/v2/setting/adserversetting`
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ADServerConnect'
            example:
              adType: E
              RedirectionUri: https://192.168.12.161/api/v2/entraid/auth
              scheduleSyncInterval: 0
              syncType: 'N'
              useSSL: false
              adlogin: false
              adEnable: '0'
              serverAddress: ''
              userName: 3323232-1111-33b6-a0a0-dfeq6bc7a762
              password: asdfasdfas~!2sdfsdfasdf
              userDomainName: test.onmicrosoft.com
              syncEvtCheck: true
              prevAdType: E
              prevDomainName: ''
              prevServerAddr: ''
              resetSync: false
              useCustomField: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/setting/syncadserver \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
            |  \
              http POST https://{baseurl}/api/v2/setting/syncadserver \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}' \
              --output-document \
              - https://{baseurl}/api/v2/setting/syncadserver
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/syncadserver",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              serverAddress: '',
              userName: '3323232-1111-33b6-a0a0-dfeq6bc7a762',
              password: 'asdfasdfas~!2sdfsdfasdf',
              userDomainName: 'test.onmicrosoft.com',
              useSSL: false,
              adlogin: false,
              RedirectionUri: 'https://127.0.0.1/api/v2/entraid/auth',
              adEnable: '0',
              adType: 'E',
              prevAdType: 'E',
              prevDomainName: 'test.onmicrosoft.com',
              prevServerAddr: '',
              resetSync: false,
              scheduleSyncInterval: 0,
              syncEvtCheck: false,
              syncType: 'N',
              useCustomField: true
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/syncadserver',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                serverAddress: '',
                userName: '3323232-1111-33b6-a0a0-dfeq6bc7a762',
                password: 'asdfasdfas~!2sdfsdfasdf',
                userDomainName: 'test.onmicrosoft.com',
                useSSL: false,
                adlogin: false,
                RedirectionUri: 'https://127.0.0.1/api/v2/entraid/auth',
                adEnable: '0',
                adType: 'E',
                prevAdType: 'E',
                prevDomainName: 'test.onmicrosoft.com',
                prevServerAddr: '',
                resetSync: false,
                scheduleSyncInterval: 0,
                syncEvtCheck: false,
                syncType: 'N',
                useCustomField: true
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/setting/syncadserver");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "serverAddress": "",
              "userName": "3323232-1111-33b6-a0a0-dfeq6bc7a762",
              "password": "asdfasdfas~!2sdfsdfasdf",
              "userDomainName": "test.onmicrosoft.com",
              "useSSL": false,
              "adlogin": false,
              "RedirectionUri": "https://127.0.0.1/api/v2/entraid/auth",
              "adEnable": "0",
              "adType": "E",
              "prevAdType": "E",
              "prevDomainName": "test.onmicrosoft.com",
              "prevServerAddr": "",
              "resetSync": false,
              "scheduleSyncInterval": 0,
              "syncEvtCheck": false,
              "syncType": "N",
              "useCustomField": true
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/setting/syncadserver',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                serverAddress: '',
                userName: '3323232-1111-33b6-a0a0-dfeq6bc7a762',
                password: 'asdfasdfas~!2sdfsdfasdf',
                userDomainName: 'test.onmicrosoft.com',
                useSSL: false,
                adlogin: false,
                RedirectionUri: 'https://127.0.0.1/api/v2/entraid/auth',
                adEnable: '0',
                adType: 'E',
                prevAdType: 'E',
                prevDomainName: 'test.onmicrosoft.com',
                prevServerAddr: '',
                resetSync: false,
                scheduleSyncInterval: 0,
                syncEvtCheck: false,
                syncType: 'N',
                useCustomField: true
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/setting/syncadserver';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
            };

            fetch('https://{baseurl}/api/v2/setting/syncadserver', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/syncadserver",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "serverAddress": "",
              "userName": "3323232-1111-33b6-a0a0-dfeq6bc7a762",
              "password": "asdfasdfas~!2sdfsdfasdf",
              "userDomainName": "test.onmicrosoft.com",
              "useSSL": false,
              "adlogin": false,
              "RedirectionUri": "https://127.0.0.1/api/v2/entraid/auth",
              "adEnable": "0",
              "adType": "E",
              "prevAdType": "E",
              "prevDomainName": "test.onmicrosoft.com",
              "prevServerAddr": "",
              "resetSync": false,
              "scheduleSyncInterval": 0,
              "syncEvtCheck": false,
              "syncType": "N",
              "useCustomField": true
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/setting/syncadserver");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/setting/syncadserver",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/setting/syncadserver"


            payload = {
                "serverAddress": "",
                "userName": "3323232-1111-33b6-a0a0-dfeq6bc7a762",
                "password": "asdfasdfas~!2sdfsdfasdf",
                "userDomainName": "test.onmicrosoft.com",
                "useSSL": False,
                "adlogin": False,
                "RedirectionUri": "https://127.0.0.1/api/v2/entraid/auth",
                "adEnable": "0",
                "adType": "E",
                "prevAdType": "E",
                "prevDomainName": "test.onmicrosoft.com",
                "prevServerAddr": "",
                "resetSync": False,
                "scheduleSyncInterval": 0,
                "syncEvtCheck": False,
                "syncType": "N",
                "useCustomField": True
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/setting/syncadserver")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/syncadserver",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/syncadserver');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}');


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/syncadserver');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/syncadserver")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/setting/syncadserver")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/syncadserver\"\n\n\tpayload := strings.NewReader(\"{\\\"serverAddress\\\":\\\"\\\",\\\"userName\\\":\\\"3323232-1111-33b6-a0a0-dfeq6bc7a762\\\",\\\"password\\\":\\\"asdfasdfas~!2sdfsdfasdf\\\",\\\"userDomainName\\\":\\\"test.onmicrosoft.com\\\",\\\"useSSL\\\":false,\\\"adlogin\\\":false,\\\"RedirectionUri\\\":\\\"https://127.0.0.1/api/v2/entraid/auth\\\",\\\"adEnable\\\":\\\"0\\\",\\\"adType\\\":\\\"E\\\",\\\"prevAdType\\\":\\\"E\\\",\\\"prevDomainName\\\":\\\"test.onmicrosoft.com\\\",\\\"prevServerAddr\\\":\\\"\\\",\\\"resetSync\\\":false,\\\"scheduleSyncInterval\\\":0,\\\"syncEvtCheck\\\":false,\\\"syncType\\\":\\\"N\\\",\\\"useCustomField\\\":true}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/syncadserver");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"serverAddress": @"",
                                          @"userName": @"3323232-1111-33b6-a0a0-dfeq6bc7a762",
                                          @"password": @"asdfasdfas~!2sdfsdfasdf",
                                          @"userDomainName": @"test.onmicrosoft.com",
                                          @"useSSL": @NO,
                                          @"adlogin": @NO,
                                          @"RedirectionUri": @"https://127.0.0.1/api/v2/entraid/auth",
                                          @"adEnable": @"0",
                                          @"adType": @"E",
                                          @"prevAdType": @"E",
                                          @"prevDomainName": @"test.onmicrosoft.com",
                                          @"prevServerAddr": @"",
                                          @"resetSync": @NO,
                                          @"scheduleSyncInterval": @0,
                                          @"syncEvtCheck": @NO,
                                          @"syncType": @"N",
                                          @"useCustomField": @YES };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/syncadserver"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "serverAddress": "",
              "userName": "3323232-1111-33b6-a0a0-dfeq6bc7a762",
              "password": "asdfasdfas~!2sdfsdfasdf",
              "userDomainName": "test.onmicrosoft.com",
              "useSSL": false,
              "adlogin": false,
              "RedirectionUri": "https://127.0.0.1/api/v2/entraid/auth",
              "adEnable": "0",
              "adType": "E",
              "prevAdType": "E",
              "prevDomainName": "test.onmicrosoft.com",
              "prevServerAddr": "",
              "resetSync": false,
              "scheduleSyncInterval": 0,
              "syncEvtCheck": false,
              "syncType": "N",
              "useCustomField": true
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/syncadserver")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/syncadserver");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/syncadserver"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/syncadserver' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/syncadserver' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"serverAddress":"","userName":"3323232-1111-33b6-a0a0-dfeq6bc7a762","password":"asdfasdfas~!2sdfsdfasdf","userDomainName":"test.onmicrosoft.com","useSSL":false,"adlogin":false,"RedirectionUri":"https://127.0.0.1/api/v2/entraid/auth","adEnable":"0","adType":"E","prevAdType":"E","prevDomainName":"test.onmicrosoft.com","prevServerAddr":"","resetSync":false,"scheduleSyncInterval":0,"syncEvtCheck":false,"syncType":"N","useCustomField":true}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/syncadserver"


            payload <-
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/syncadserver" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"serverAddress\":\"\",\"userName\":\"3323232-1111-33b6-a0a0-dfeq6bc7a762\",\"password\":\"asdfasdfas~!2sdfsdfasdf\",\"userDomainName\":\"test.onmicrosoft.com\",\"useSSL\":false,\"adlogin\":false,\"RedirectionUri\":\"https://127.0.0.1/api/v2/entraid/auth\",\"adEnable\":\"0\",\"adType\":\"E\",\"prevAdType\":\"E\",\"prevDomainName\":\"test.onmicrosoft.com\",\"prevServerAddr\":\"\",\"resetSync\":false,\"scheduleSyncInterval\":0,\"syncEvtCheck\":false,\"syncType\":\"N\",\"useCustomField\":true}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/syncadserver")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/adserversetting:
    get:
      tags:
        - Active Directory
      summary: View AD Server Setting
      operationId: getAdserversetting
      description: Retrieves AD server configurations.
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              examples:
                example-0:
                  summary: AD Status
                  value:
                    ADServerSettingCollection:
                      total: 1
                      rows:
                        - serverAddress: 192.111.22.3
                          userName: test
                          password: test1!
                          userDomainName: DC=test,DC=co,DC=kr
                          lastSyncTime: 1748311298580
                          lastSyncResult: '0'
                          lastUpdateTime: 1748311298580
                          useSSL: false
                          adlogin: false
                          adType: A
                          scheduleSyncInterval: 0
                          adEnable: '0'
                          syncEvtCheck: false
                          resetSync: false
                          targetUserIds: []
                    Response:
                      code: '0'
                      link: https://support.supremainc.com/en/support/home
                      message: success
                      by: web
                example-1:
                  summary: EntraID Status
                  value:
                    ADServerSettingCollection:
                      total: 1
                      rows:
                        - serverAddress: ''
                          userName: 3323232-1111-33b6-a0a0-dfeq6bc7a762
                          password: asdfasdfas~!2sdfsdfasdf
                          userDomainName: test.onmicrosoft.com
                          useSSL: false
                          adlogin: false
                          adType: E
                          scheduleSyncInterval: 0
                          adEnable: '0'
                          syncEvtCheck: false
                          resetSync: false
                          targetUserIds: []
                    Response:
                      code: '0'
                      link: https://support.supremainc.com/en/support/home
                      message: success
                      by: web
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/setting/adserversetting \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/setting/adserversetting \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/setting/adserversetting
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/adserversetting",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/adserversetting',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/setting/adserversetting");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/adserversetting',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/setting/adserversetting';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/setting/adserversetting', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/adserversetting",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/v2/setting/adserversetting");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/setting/adserversetting",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/setting/adserversetting"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/setting/adserversetting")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/adserversetting",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/adserversetting');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/adserversetting');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adserversetting")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/setting/adserversetting")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/adserversetting\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/adserversetting");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/adserversetting"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/adserversetting")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/adserversetting");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/adserversetting"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/adserversetting' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/adserversetting' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/adserversetting"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/adserversetting" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adserversetting")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/adusrmappinglist:
    get:
      tags:
        - Active Directory
      summary: View AD User Mapping List
      operationId: getAdusrmappinglist
      description: >-
        Retrieves the mapping relationships between user attribute fields in
        BioStar X and those used in Active Directory or Entra ID.


        Please note that the required mapping information differs between Entra
        ID and Active Directory.
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              examples:
                example-0:
                  summary: When Linked with EntraID
                  value:
                    ADUsrMappingCollection:
                      total: 9
                      rows:
                        - columnm: userID
                          adcolumnm: none
                        - columnm: userName
                          adcolumnm: displayName
                        - columnm: email
                          adcolumnm: mail
                        - columnm: phone
                          adcolumnm: businessPhones
                        - columnm: expiry_datetime
                          adcolumnm: employeeLeaveDateTime
                        - columnm: department
                          adcolumnm: department
                        - columnm: user_title
                          adcolumnm: jobTitle
                        - columnm: usergroup
                          adcolumnm: memberOf
                    Response:
                      code: '0'
                      link: https://support.supremainc.com/en/support/home
                      message: success
                      by: web
                example-1:
                  summary: When Linked with Active Directory
                  value:
                    ADUsrMappingCollection:
                      total: 9
                      rows:
                        - columnm: userID
                          adcolumnm: sAMAccountName
                        - columnm: userName
                          adcolumnm: displayName
                        - columnm: email
                          adcolumnm: mail
                        - columnm: phone
                          adcolumnm: telephoneNumber
                        - columnm: expiry_datetime
                          adcolumnm: accountExpires
                        - columnm: department
                          adcolumnm: department
                        - columnm: user_title
                          adcolumnm: title
                        - columnm: usergroup
                          adcolumnm: distinguishedName
                    Response:
                      code: '0'
                      link: https://support.supremainc.com/en/support/home
                      message: success
                      by: web
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/setting/adusrmappinglist \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/setting/adusrmappinglist \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/setting/adusrmappinglist
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/adusrmappinglist",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/adusrmappinglist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/setting/adusrmappinglist");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/adusrmappinglist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/setting/adusrmappinglist';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/setting/adusrmappinglist', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/adusrmappinglist",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/setting/adusrmappinglist");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/setting/adusrmappinglist",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/setting/adusrmappinglist"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/setting/adusrmappinglist")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/adusrmappinglist",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/adusrmappinglist');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/adusrmappinglist');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adusrmappinglist")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/setting/adusrmappinglist")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/adusrmappinglist\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/adusrmappinglist");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/adusrmappinglist"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/adusrmappinglist")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/adusrmappinglist");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/adusrmappinglist"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/adusrmappinglist' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/adusrmappinglist' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/adusrmappinglist"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/adusrmappinglist" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adusrmappinglist")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/adcolumnlist:
    get:
      tags:
        - Active Directory
      summary: View AD Column List
      operationId: getAdcolumnlist
      description: Retrieve user property information used by Active Directory or EntraID.
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              example:
                List<String>:
                  total: 286
                  rows:
                    - seq: 208
                      adcolumnm: aboutMe
                      adtype: E
                    - seq: 209
                      adcolumnm: accountEnabled
                      adtype: E
                    - seq: 1
                      adcolumnm: accountExpires
                      adtype: A
                    - seq: 2
                      adcolumnm: accountNameHistory
                      adtype: A
                    - seq: 3
                      adcolumnm: aCSPolicyName
                      adtype: A
                    - seq: 4
                      adcolumnm: adminCount
                      adtype: A
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: success
                  by: web
                ADColumnCollection:
                  total: 286
                  rows:
                    - seq: 208
                      adcolumnm: aboutMe
                      adtype: E
                    - seq: 209
                      adcolumnm: accountEnabled
                      adtype: E
                    - seq: 1
                      adcolumnm: accountExpires
                      adtype: A
                    - seq: 2
                      adcolumnm: accountNameHistory
                      adtype: A
                    - seq: 3
                      adcolumnm: aCSPolicyName
                      adtype: A
                    - seq: 4
                      adcolumnm: adminCount
                      adtype: A
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/setting/adcolumnlist \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/setting/adcolumnlist \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/setting/adcolumnlist
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/adcolumnlist",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/adcolumnlist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/setting/adcolumnlist");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/adcolumnlist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/setting/adcolumnlist';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/setting/adcolumnlist', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/adcolumnlist",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/v2/setting/adcolumnlist");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/setting/adcolumnlist",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/setting/adcolumnlist"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/setting/adcolumnlist")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/adcolumnlist",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/setting/adcolumnlist');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/adcolumnlist');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adcolumnlist")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/setting/adcolumnlist")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/adcolumnlist\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/adcolumnlist");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/adcolumnlist"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/adcolumnlist")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/adcolumnlist");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/adcolumnlist"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/adcolumnlist' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/adcolumnlist' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/adcolumnlist"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/adcolumnlist" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/adcolumnlist")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/setting/checkEntraIDSetting:
    get:
      tags:
        - Active Directory
      summary: Check EntraID SSO Login Setting
      operationId: getCheckentraidsetting
      description: >-
        Checks whether Entra ID SSO Login is enabled.


        If the **"BioStar X Login with Entra ID"** option is enabled in the
        Directory Integration settings, the returned value is `'E'`. If it is
        disabled (default), the value is `'D'`.
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              examples:
                example-0:
                  summary: Disabled
                  value:
                    code: '0'
                    link: https://support.supremainc.com/en/support/home
                    message: D
                    by: web
                example-1:
                  summary: Enabled
                  value:
                    code: '0'
                    link: https://support.supremainc.com/en/support/home
                    message: E
                    by: web
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/setting/checkEntraIDSetting \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/setting/checkEntraIDSetting \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/setting/checkEntraIDSetting
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/setting/checkEntraIDSetting",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/checkEntraIDSetting',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/setting/checkEntraIDSetting");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/setting/checkEntraIDSetting',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/setting/checkEntraIDSetting';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/setting/checkEntraIDSetting',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/setting/checkEntraIDSetting",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/setting/checkEntraIDSetting");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/setting/checkEntraIDSetting",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/setting/checkEntraIDSetting"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/setting/checkEntraIDSetting")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/setting/checkEntraIDSetting",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/setting/checkEntraIDSetting');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/setting/checkEntraIDSetting');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/setting/checkEntraIDSetting")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/setting/checkEntraIDSetting")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/setting/checkEntraIDSetting\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/setting/checkEntraIDSetting");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/setting/checkEntraIDSetting"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/setting/checkEntraIDSetting")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/setting/checkEntraIDSetting");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/setting/checkEntraIDSetting"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/setting/checkEntraIDSetting' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/setting/checkEntraIDSetting' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/setting/checkEntraIDSetting"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/setting/checkEntraIDSetting" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/setting/checkEntraIDSetting")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/setting_email:
    get:
      tags:
        - Email Setting
      summary: View Email Setting
      operationId: getEmail
      description: >-
        This API is used to view the email template for Visual Face and BioStar
        X QR.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/setting_email \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/setting_email \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/setting_email
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting_email",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/setting_email',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/setting_email");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/setting_email',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/setting_email';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/setting_email', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting_email",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/setting_email");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/setting_email", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/setting_email"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/setting_email")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting_email",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/setting_email');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/setting_email');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting_email")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/setting_email")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting_email\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting_email");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting_email"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting_email")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/setting_email");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/setting_email"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting_email' -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting_email' -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting_email"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/setting_email" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting_email")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Email Setting
      summary: Create Email Setting (Visual Face / QR)
      operationId: createEmail
      description: This API is used to set email template for Visual Face and BioStar X QR.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailSettings'
      parameters:
        - name: email_type
          in: query
          schema:
            type: integer
          description: 1:Visual face mobile enrollment contents, 2:QR credential contents
          example: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/setting_email?email_type=1' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"title":"VisualFace","company_name":"Suprema Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"title":"VisualFace","company_name":"Suprema
            Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
            |  \
              http POST 'https://{baseurl}/api/setting_email?email_type=1' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"title":"VisualFace","company_name":"Suprema Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}' \
              --output-document \
              - 'https://{baseurl}/api/setting_email?email_type=1'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting_email?email_type=1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              title: 'VisualFace',
              company_name: 'Suprema Inc.',
              company_logo: '',
              admin_contact: 'admin@example.com',
              use_setting: true
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/setting_email',
              qs: {email_type: '1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                title: 'VisualFace',
                company_name: 'Suprema Inc.',
                company_logo: '',
                admin_contact: 'admin@example.com',
                use_setting: true
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/setting_email");

            req.query({
              "email_type": "1"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "title": "VisualFace",
              "company_name": "Suprema Inc.",
              "company_logo": "",
              "admin_contact": "admin@example.com",
              "use_setting": true
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/setting_email',
              params: {email_type: '1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                title: 'VisualFace',
                company_name: 'Suprema Inc.',
                company_logo: '',
                admin_contact: 'admin@example.com',
                use_setting: true
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/setting_email?email_type=1';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"title":"VisualFace","company_name":"Suprema Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"title":"VisualFace","company_name":"Suprema Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
            };

            fetch('https://{baseurl}/api/setting_email?email_type=1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting_email?email_type=1",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"title\":\"VisualFace\",\"company_name\":\"Suprema Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "title": "VisualFace",
              "company_name": "Suprema Inc.",
              "company_logo": "",
              "admin_contact": "admin@example.com",
              "use_setting": true
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/setting_email?email_type=1");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/setting_email?email_type=1",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/setting_email"


            querystring = {"email_type":"1"}


            payload = {
                "title": "VisualFace",
                "company_name": "Suprema Inc.",
                "company_logo": "",
                "admin_contact": "admin@example.com",
                "use_setting": True
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/setting_email?email_type=1")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting_email?email_type=1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"title\":\"VisualFace\",\"company_name\":\"Suprema Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/setting_email');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'email_type' => '1'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"title":"VisualFace","company_name":"Suprema
            Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"title":"VisualFace","company_name":"Suprema
            Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}');


            $request->setRequestUrl('https://{baseurl}/api/setting_email');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'email_type' => '1'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting_email?email_type=1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/setting_email?email_type=1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"title\":\"VisualFace\",\"company_name\":\"Suprema Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting_email?email_type=1\"\n\n\tpayload := strings.NewReader(\"{\\\"title\\\":\\\"VisualFace\\\",\\\"company_name\\\":\\\"Suprema Inc.\\\",\\\"company_logo\\\":\\\"\\\",\\\"admin_contact\\\":\\\"admin@example.com\\\",\\\"use_setting\\\":true}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting_email?email_type=1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"title": @"VisualFace",
                                          @"company_name": @"Suprema Inc.",
                                          @"company_logo": @"",
                                          @"admin_contact": @"admin@example.com",
                                          @"use_setting": @YES };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting_email?email_type=1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "title": "VisualFace",
              "company_name": "Suprema Inc.",
              "company_logo": "",
              "admin_contact": "admin@example.com",
              "use_setting": true
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting_email?email_type=1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting_email?email_type=1");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/setting_email?email_type=1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"title\":\"VisualFace\",\"company_name\":\"Suprema Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting_email?email_type=1' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"title":"VisualFace","company_name":"Suprema
            Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting_email?email_type=1' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"title":"VisualFace","company_name":"Suprema
            Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting_email"


            queryString <- list([ 'email_type' ] = "1")


            payload <- "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting_email?email_type=1" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting_email?email_type=1")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    put:
      tags:
        - Email Setting
      summary: Update Email Setting (Visual Face / QR)
      operationId: updateEmail
      description: This API is used to set email template for Visual Face and BioStar X QR.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailSettings'
      parameters:
        - name: email_type
          in: query
          schema:
            type: integer
          description: 1:Visual face mobile enrollment contents, 2:QR credential contents
          example: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url 'https://{baseurl}/api/setting_email?email_type=1' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"title":"VisualFace","company_name":"Suprema Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"title":"VisualFace","company_name":"Suprema
            Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
            |  \
              http PUT 'https://{baseurl}/api/setting_email?email_type=1' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"title":"VisualFace","company_name":"Suprema Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}' \
              --output-document \
              - 'https://{baseurl}/api/setting_email?email_type=1'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting_email?email_type=1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              title: 'VisualFace',
              company_name: 'Suprema Inc.',
              company_logo: '',
              admin_contact: 'admin@example.com',
              use_setting: true
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting_email',
              qs: {email_type: '1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                title: 'VisualFace',
                company_name: 'Suprema Inc.',
                company_logo: '',
                admin_contact: 'admin@example.com',
                use_setting: true
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/setting_email");

            req.query({
              "email_type": "1"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "title": "VisualFace",
              "company_name": "Suprema Inc.",
              "company_logo": "",
              "admin_contact": "admin@example.com",
              "use_setting": true
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting_email',
              params: {email_type: '1'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                title: 'VisualFace',
                company_name: 'Suprema Inc.',
                company_logo: '',
                admin_contact: 'admin@example.com',
                use_setting: true
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/setting_email?email_type=1';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"title":"VisualFace","company_name":"Suprema Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"title":"VisualFace","company_name":"Suprema Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
            };

            fetch('https://{baseurl}/api/setting_email?email_type=1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting_email?email_type=1",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"title\":\"VisualFace\",\"company_name\":\"Suprema Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "title": "VisualFace",
              "company_name": "Suprema Inc.",
              "company_logo": "",
              "admin_contact": "admin@example.com",
              "use_setting": true
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/setting_email?email_type=1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/setting_email?email_type=1",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/setting_email"


            querystring = {"email_type":"1"}


            payload = {
                "title": "VisualFace",
                "company_name": "Suprema Inc.",
                "company_logo": "",
                "admin_contact": "admin@example.com",
                "use_setting": True
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/setting_email?email_type=1")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting_email?email_type=1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"title\":\"VisualFace\",\"company_name\":\"Suprema Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/setting_email');

            $request->setMethod(HTTP_METH_PUT);


            $request->setQueryData([
              'email_type' => '1'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"title":"VisualFace","company_name":"Suprema
            Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"title":"VisualFace","company_name":"Suprema
            Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}');


            $request->setRequestUrl('https://{baseurl}/api/setting_email');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'email_type' => '1'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting_email?email_type=1")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/setting_email?email_type=1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"title\":\"VisualFace\",\"company_name\":\"Suprema Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting_email?email_type=1\"\n\n\tpayload := strings.NewReader(\"{\\\"title\\\":\\\"VisualFace\\\",\\\"company_name\\\":\\\"Suprema Inc.\\\",\\\"company_logo\\\":\\\"\\\",\\\"admin_contact\\\":\\\"admin@example.com\\\",\\\"use_setting\\\":true}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting_email?email_type=1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"title": @"VisualFace",
                                          @"company_name": @"Suprema Inc.",
                                          @"company_logo": @"",
                                          @"admin_contact": @"admin@example.com",
                                          @"use_setting": @YES };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting_email?email_type=1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "title": "VisualFace",
              "company_name": "Suprema Inc.",
              "company_logo": "",
              "admin_contact": "admin@example.com",
              "use_setting": true
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting_email?email_type=1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting_email?email_type=1");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/setting_email?email_type=1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"title\":\"VisualFace\",\"company_name\":\"Suprema Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting_email?email_type=1' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"title":"VisualFace","company_name":"Suprema
            Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting_email?email_type=1' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"title":"VisualFace","company_name":"Suprema
            Inc.","company_logo":"","admin_contact":"admin@example.com","use_setting":true}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting_email"


            queryString <- list([ 'email_type' ] = "1")


            payload <- "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting_email?email_type=1" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"title\":\"VisualFace\",\"company_name\":\"Suprema
            Inc.\",\"company_logo\":\"\",\"admin_contact\":\"admin@example.com\",\"use_setting\":true}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting_email?email_type=1")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/setting/alarm_smtps:
    get:
      tags:
        - Email Setting
      summary: View SMTP Setting
      operationId: listAlarmSmtps
      description: >-
        This API is used to view the SMTP (Simple Mail Transfer Protocol) for
        sending emails.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/setting/alarm_smtps \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/setting/alarm_smtps \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/setting/alarm_smtps
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/alarm_smtps",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/setting/alarm_smtps',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/setting/alarm_smtps");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/setting/alarm_smtps',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/setting/alarm_smtps';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/setting/alarm_smtps', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/alarm_smtps",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/setting/alarm_smtps");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/setting/alarm_smtps",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/setting/alarm_smtps"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/setting/alarm_smtps")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/alarm_smtps",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/setting/alarm_smtps');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/setting/alarm_smtps');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/alarm_smtps")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/setting/alarm_smtps")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/alarm_smtps\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/alarm_smtps");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/alarm_smtps"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/alarm_smtps")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/alarm_smtps");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/setting/alarm_smtps"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/alarm_smtps' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/alarm_smtps' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/alarm_smtps"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/setting/alarm_smtps"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/alarm_smtps")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Email Setting
      summary: Create SMTP Setting
      operationId: createAlarmSmtps
      description: >-
        This API is used to set the SMTP (Simple Mail Transfer Protocol) for
        sending emails.


        **Note:**


        When using an SMTP server with an email account that has two-factor
        authentication (2FA) enabled, be aware of the following:

        - Once 2FA is set up, the SMTP password is **not** the same as the email
        account password. Instead, it corresponds to an **app password**
        generated specifically for use with 2FA.

        - If you change the email account password, all existing app passwords
        are automatically revoked. As a result, the previously configured SMTP
        password will no longer work.

        - After changing the email account password, you must **generate a new
        app password** and **update the SMTP settings** with the new value.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SMTPSettings'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/setting/alarm_smtps \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example
            SMTP
            Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
            |  \
              http POST https://{baseurl}/api/setting/alarm_smtps \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}' \
              --output-document \
              - https://{baseurl}/api/setting/alarm_smtps
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/alarm_smtps",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              AlarmSmtp: {
                name: 'smtp.example.com',
                description: 'Example SMTP Server',
                smtp_server_addr: 'smtp.example.com',
                smtp_server_port: '587',
                smtp_username: 'user@example.com',
                smtp_password: 'pa$$word',
                smtp_security: '2',
                smtp_sender: 'sender@example.com'
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/setting/alarm_smtps',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                AlarmSmtp: {
                  name: 'smtp.example.com',
                  description: 'Example SMTP Server',
                  smtp_server_addr: 'smtp.example.com',
                  smtp_server_port: '587',
                  smtp_username: 'user@example.com',
                  smtp_password: 'pa$$word',
                  smtp_security: '2',
                  smtp_sender: 'sender@example.com'
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/setting/alarm_smtps");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "AlarmSmtp": {
                "name": "smtp.example.com",
                "description": "Example SMTP Server",
                "smtp_server_addr": "smtp.example.com",
                "smtp_server_port": "587",
                "smtp_username": "user@example.com",
                "smtp_password": "pa$$word",
                "smtp_security": "2",
                "smtp_sender": "sender@example.com"
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/setting/alarm_smtps',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                AlarmSmtp: {
                  name: 'smtp.example.com',
                  description: 'Example SMTP Server',
                  smtp_server_addr: 'smtp.example.com',
                  smtp_server_port: '587',
                  smtp_username: 'user@example.com',
                  smtp_password: 'pa$$word',
                  smtp_security: '2',
                  smtp_sender: 'sender@example.com'
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/setting/alarm_smtps';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
            };

            fetch('https://{baseurl}/api/setting/alarm_smtps', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/alarm_smtps",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example SMTP Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "AlarmSmtp": {
                "name": "smtp.example.com",
                "description": "Example SMTP Server",
                "smtp_server_addr": "smtp.example.com",
                "smtp_server_port": "587",
                "smtp_username": "user@example.com",
                "smtp_password": "pa$$word",
                "smtp_security": "2",
                "smtp_sender": "sender@example.com"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/setting/alarm_smtps");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/setting/alarm_smtps", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/setting/alarm_smtps"


            payload = {"AlarmSmtp": {
                    "name": "smtp.example.com",
                    "description": "Example SMTP Server",
                    "smtp_server_addr": "smtp.example.com",
                    "smtp_server_port": "587",
                    "smtp_username": "user@example.com",
                    "smtp_password": "pa$$word",
                    "smtp_security": "2",
                    "smtp_sender": "sender@example.com"
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/setting/alarm_smtps")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/alarm_smtps",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example SMTP Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/setting/alarm_smtps');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"AlarmSmtp":{"name":"smtp.example.com","description":"Example
            SMTP
            Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"AlarmSmtp":{"name":"smtp.example.com","description":"Example
            SMTP
            Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}');


            $request->setRequestUrl('https://{baseurl}/api/setting/alarm_smtps');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/alarm_smtps")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/setting/alarm_smtps")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example SMTP Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/alarm_smtps\"\n\n\tpayload := strings.NewReader(\"{\\\"AlarmSmtp\\\":{\\\"name\\\":\\\"smtp.example.com\\\",\\\"description\\\":\\\"Example SMTP Server\\\",\\\"smtp_server_addr\\\":\\\"smtp.example.com\\\",\\\"smtp_server_port\\\":\\\"587\\\",\\\"smtp_username\\\":\\\"user@example.com\\\",\\\"smtp_password\\\":\\\"pa$$word\\\",\\\"smtp_security\\\":\\\"2\\\",\\\"smtp_sender\\\":\\\"sender@example.com\\\"}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/alarm_smtps");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"AlarmSmtp": @{ @"name":
            @"smtp.example.com", @"description": @"Example SMTP Server",
            @"smtp_server_addr": @"smtp.example.com", @"smtp_server_port":
            @"587", @"smtp_username": @"user@example.com", @"smtp_password":
            @"pa$$word", @"smtp_security": @"2", @"smtp_sender":
            @"sender@example.com" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/alarm_smtps"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["AlarmSmtp": [
                "name": "smtp.example.com",
                "description": "Example SMTP Server",
                "smtp_server_addr": "smtp.example.com",
                "smtp_server_port": "587",
                "smtp_username": "user@example.com",
                "smtp_password": "pa$$word",
                "smtp_security": "2",
                "smtp_sender": "sender@example.com"
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/alarm_smtps")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/alarm_smtps");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/setting/alarm_smtps"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example SMTP Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/alarm_smtps' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP
            Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/alarm_smtps' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP
            Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/alarm_smtps"


            payload <-
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/setting/alarm_smtps"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/alarm_smtps")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/setting/alarm_smtps/{id}:
    put:
      tags:
        - Email Setting
      summary: Update SMTP Setting
      operationId: updateAlarmSmtps
      description: >-
        This API is used to update the SMTP (Simple Mail Transfer Protocol) for
        sending emails.


        **Note:**


        When using an SMTP server with an email account that has two-factor
        authentication (2FA) enabled, be aware of the following:

        - Once 2FA is set up, the SMTP password is **not** the same as the email
        account  password. Instead, it corresponds to an **app password**
        generated specifically for use with 2FA.
            
        - If you change the email account password, all existing app passwords
        are automatically revoked. As a result, the previously configured SMTP
        password will no longer work.
            
        - After changing the email account password, you must **generate a new
        app password** and **update the SMTP settings** with the new value.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SMTPSettings'
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the SMTP setting which will be updated.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/setting/alarm_smtps/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example
            SMTP
            Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
            |  \
              http PUT https://{baseurl}/api/setting/alarm_smtps/{id} \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}' \
              --output-document \
              - https://{baseurl}/api/setting/alarm_smtps/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/alarm_smtps/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              AlarmSmtp: {
                name: 'smtp.example.com',
                description: 'Example SMTP Server',
                smtp_server_addr: 'smtp.example.com',
                smtp_server_port: '587',
                smtp_username: 'user@example.com',
                smtp_password: 'pa$$word',
                smtp_security: '2',
                smtp_sender: 'sender@example.com'
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting/alarm_smtps/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                AlarmSmtp: {
                  name: 'smtp.example.com',
                  description: 'Example SMTP Server',
                  smtp_server_addr: 'smtp.example.com',
                  smtp_server_port: '587',
                  smtp_username: 'user@example.com',
                  smtp_password: 'pa$$word',
                  smtp_security: '2',
                  smtp_sender: 'sender@example.com'
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/setting/alarm_smtps/{id}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "AlarmSmtp": {
                "name": "smtp.example.com",
                "description": "Example SMTP Server",
                "smtp_server_addr": "smtp.example.com",
                "smtp_server_port": "587",
                "smtp_username": "user@example.com",
                "smtp_password": "pa$$word",
                "smtp_security": "2",
                "smtp_sender": "sender@example.com"
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting/alarm_smtps/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                AlarmSmtp: {
                  name: 'smtp.example.com',
                  description: 'Example SMTP Server',
                  smtp_server_addr: 'smtp.example.com',
                  smtp_server_port: '587',
                  smtp_username: 'user@example.com',
                  smtp_password: 'pa$$word',
                  smtp_security: '2',
                  smtp_sender: 'sender@example.com'
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/setting/alarm_smtps/{id}';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
            };

            fetch('https://{baseurl}/api/setting/alarm_smtps/{id}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/alarm_smtps/{id}",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example SMTP Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "AlarmSmtp": {
                "name": "smtp.example.com",
                "description": "Example SMTP Server",
                "smtp_server_addr": "smtp.example.com",
                "smtp_server_port": "587",
                "smtp_username": "user@example.com",
                "smtp_password": "pa$$word",
                "smtp_security": "2",
                "smtp_sender": "sender@example.com"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/setting/alarm_smtps/{id}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/setting/alarm_smtps/{id}",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/setting/alarm_smtps/{id}"


            payload = {"AlarmSmtp": {
                    "name": "smtp.example.com",
                    "description": "Example SMTP Server",
                    "smtp_server_addr": "smtp.example.com",
                    "smtp_server_port": "587",
                    "smtp_username": "user@example.com",
                    "smtp_password": "pa$$word",
                    "smtp_security": "2",
                    "smtp_sender": "sender@example.com"
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/setting/alarm_smtps/{id}")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/alarm_smtps/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example SMTP Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/setting/alarm_smtps/{id}');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"AlarmSmtp":{"name":"smtp.example.com","description":"Example
            SMTP
            Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"AlarmSmtp":{"name":"smtp.example.com","description":"Example
            SMTP
            Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}');


            $request->setRequestUrl('https://{baseurl}/api/setting/alarm_smtps/{id}');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/alarm_smtps/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/setting/alarm_smtps/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example SMTP Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/alarm_smtps/{id}\"\n\n\tpayload := strings.NewReader(\"{\\\"AlarmSmtp\\\":{\\\"name\\\":\\\"smtp.example.com\\\",\\\"description\\\":\\\"Example SMTP Server\\\",\\\"smtp_server_addr\\\":\\\"smtp.example.com\\\",\\\"smtp_server_port\\\":\\\"587\\\",\\\"smtp_username\\\":\\\"user@example.com\\\",\\\"smtp_password\\\":\\\"pa$$word\\\",\\\"smtp_security\\\":\\\"2\\\",\\\"smtp_sender\\\":\\\"sender@example.com\\\"}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/alarm_smtps/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"AlarmSmtp": @{ @"name":
            @"smtp.example.com", @"description": @"Example SMTP Server",
            @"smtp_server_addr": @"smtp.example.com", @"smtp_server_port":
            @"587", @"smtp_username": @"user@example.com", @"smtp_password":
            @"pa$$word", @"smtp_security": @"2", @"smtp_sender":
            @"sender@example.com" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/alarm_smtps/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["AlarmSmtp": [
                "name": "smtp.example.com",
                "description": "Example SMTP Server",
                "smtp_server_addr": "smtp.example.com",
                "smtp_server_port": "587",
                "smtp_username": "user@example.com",
                "smtp_password": "pa$$word",
                "smtp_security": "2",
                "smtp_sender": "sender@example.com"
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/alarm_smtps/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/alarm_smtps/{id}");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/setting/alarm_smtps/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example SMTP Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/alarm_smtps/{id}' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP
            Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/alarm_smtps/{id}' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"AlarmSmtp":{"name":"smtp.example.com","description":"Example SMTP
            Server","smtp_server_addr":"smtp.example.com","smtp_server_port":"587","smtp_username":"user@example.com","smtp_password":"pa$$word","smtp_security":"2","smtp_sender":"sender@example.com"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/alarm_smtps/{id}"


            payload <-
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting/alarm_smtps/{id}" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"AlarmSmtp\":{\"name\":\"smtp.example.com\",\"description\":\"Example
            SMTP
            Server\",\"smtp_server_addr\":\"smtp.example.com\",\"smtp_server_port\":\"587\",\"smtp_username\":\"user@example.com\",\"smtp_password\":\"pa$$word\",\"smtp_security\":\"2\",\"smtp_sender\":\"sender@example.com\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/alarm_smtps/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/test_smtp_connection:
    post:
      tags:
        - Email Setting
      summary: Test SMTP Connection
      operationId: createTestSmtpConnection
      description: >-
        This API is used to test SMTP connection by sending an email to the
        specified address.


        Do note that the address input here need to be a complete email address.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                target_email:
                  type: string
                  description: Target email address to send the test email.
                  example: example@example.com
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/test_smtp_connection \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"target_email":"example@example.com"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"target_email":"example@example.com"}' |  \
              http POST https://{baseurl}/api/test_smtp_connection \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"target_email":"example@example.com"}' \
              --output-document \
              - https://{baseurl}/api/test_smtp_connection
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/test_smtp_connection",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({target_email: 'example@example.com'}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/test_smtp_connection',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {target_email: 'example@example.com'},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/test_smtp_connection");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "target_email": "example@example.com"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/test_smtp_connection',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {target_email: 'example@example.com'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/test_smtp_connection';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"target_email":"example@example.com"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"target_email":"example@example.com"}'
            };

            fetch('https://{baseurl}/api/test_smtp_connection', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/test_smtp_connection",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"target_email\":\"example@example.com\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "target_email": "example@example.com"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/test_smtp_connection");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"target_email\":\"example@example.com\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/test_smtp_connection", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/test_smtp_connection"


            payload = {"target_email": "example@example.com"}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/test_smtp_connection")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"target_email\":\"example@example.com\"}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/test_smtp_connection",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"target_email\":\"example@example.com\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/test_smtp_connection');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"target_email":"example@example.com"}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"target_email":"example@example.com"}');


            $request->setRequestUrl('https://{baseurl}/api/test_smtp_connection');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"target_email\":\"example@example.com\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/test_smtp_connection")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/test_smtp_connection")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"target_email\":\"example@example.com\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/test_smtp_connection\"\n\n\tpayload := strings.NewReader(\"{\\\"target_email\\\":\\\"example@example.com\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/test_smtp_connection");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"target_email\":\"example@example.com\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"target_email":
            @"example@example.com" };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/test_smtp_connection"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["target_email": "example@example.com"] as [String
            : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/test_smtp_connection")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/test_smtp_connection");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"target_email\":\"example@example.com\"}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/test_smtp_connection"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"target_email\":\"example@example.com\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/test_smtp_connection' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"target_email":"example@example.com"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/test_smtp_connection' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"target_email":"example@example.com"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/test_smtp_connection"


            payload <- "{\"target_email\":\"example@example.com\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/test_smtp_connection"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"target_email\":\"example@example.com\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"target_email\":\"example@example.com\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/test_smtp_connection")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/preferences/{id}:
    get:
      tags:
        - Preference
      summary: View Preference
      operationId: listPreferences
      description: This API is used to view preference information.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the user which preference will be viewed.
          example: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/preferences/1 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/preferences/1 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/preferences/1
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/preferences/1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/preferences/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/preferences/1");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/preferences/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/preferences/1';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/preferences/1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/preferences/1",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/preferences/1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/preferences/1", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/preferences/1"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/preferences/1")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/preferences/1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/preferences/1');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/preferences/1');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/preferences/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/preferences/1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/preferences/1\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/preferences/1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/preferences/1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/preferences/1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/preferences/1");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/preferences/1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/preferences/1' -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/preferences/1' -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/preferences/1"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/preferences/1" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/preferences/1")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    put:
      tags:
        - Preference
      summary: Update Preference
      operationId: updatePreferences
      description: This API is used to update preference configuration.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Preference'
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/preferences/1 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
            |  \
              http PUT https://{baseurl}/api/preferences/1 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}' \
              --output-document \
              - https://{baseurl}/api/preferences/1
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/preferences/1",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Preference: {
                language: 'en',
                date_format: 'yyyy/MM/dd',
                time_format: 'HH:mm',
                time_long_term_format: 'HH:mm:ss',
                time_zone: '25',
                dst1: '0',
                dst2: '0',
                depend_on_os: true,
                user_id: {user_id: 6}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/preferences/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Preference: {
                  language: 'en',
                  date_format: 'yyyy/MM/dd',
                  time_format: 'HH:mm',
                  time_long_term_format: 'HH:mm:ss',
                  time_zone: '25',
                  dst1: '0',
                  dst2: '0',
                  depend_on_os: true,
                  user_id: {user_id: 6}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/preferences/1");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Preference": {
                "language": "en",
                "date_format": "yyyy/MM/dd",
                "time_format": "HH:mm",
                "time_long_term_format": "HH:mm:ss",
                "time_zone": "25",
                "dst1": "0",
                "dst2": "0",
                "depend_on_os": true,
                "user_id": {
                  "user_id": 6
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/preferences/1',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Preference: {
                  language: 'en',
                  date_format: 'yyyy/MM/dd',
                  time_format: 'HH:mm',
                  time_long_term_format: 'HH:mm:ss',
                  time_zone: '25',
                  dst1: '0',
                  dst2: '0',
                  depend_on_os: true,
                  user_id: {user_id: 6}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/preferences/1';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
            };

            fetch('https://{baseurl}/api/preferences/1', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/preferences/1",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Preference": {
                "language": "en",
                "date_format": "yyyy/MM/dd",
                "time_format": "HH:mm",
                "time_long_term_format": "HH:mm:ss",
                "time_zone": "25",
                "dst1": "0",
                "dst2": "0",
                "depend_on_os": true,
                "user_id": {
                  "user_id": 6
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/preferences/1");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/preferences/1", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/preferences/1"


            payload = {"Preference": {
                    "language": "en",
                    "date_format": "yyyy/MM/dd",
                    "time_format": "HH:mm",
                    "time_long_term_format": "HH:mm:ss",
                    "time_zone": "25",
                    "dst1": "0",
                    "dst2": "0",
                    "depend_on_os": True,
                    "user_id": {"user_id": 6}
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/preferences/1")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/preferences/1",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/preferences/1');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}');


            $request->setRequestUrl('https://{baseurl}/api/preferences/1');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/preferences/1")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/preferences/1")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/preferences/1\"\n\n\tpayload := strings.NewReader(\"{\\\"Preference\\\":{\\\"language\\\":\\\"en\\\",\\\"date_format\\\":\\\"yyyy/MM/dd\\\",\\\"time_format\\\":\\\"HH:mm\\\",\\\"time_long_term_format\\\":\\\"HH:mm:ss\\\",\\\"time_zone\\\":\\\"25\\\",\\\"dst1\\\":\\\"0\\\",\\\"dst2\\\":\\\"0\\\",\\\"depend_on_os\\\":true,\\\"user_id\\\":{\\\"user_id\\\":6}}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/preferences/1");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Preference": @{ @"language": @"en",
            @"date_format": @"yyyy/MM/dd", @"time_format": @"HH:mm",
            @"time_long_term_format": @"HH:mm:ss", @"time_zone": @"25", @"dst1":
            @"0", @"dst2": @"0", @"depend_on_os": @YES, @"user_id": @{
            @"user_id": @6 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/preferences/1"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Preference": [
                "language": "en",
                "date_format": "yyyy/MM/dd",
                "time_format": "HH:mm",
                "time_long_term_format": "HH:mm:ss",
                "time_zone": "25",
                "dst1": "0",
                "dst2": "0",
                "depend_on_os": true,
                "user_id": ["user_id": 6]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/preferences/1")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/preferences/1");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/preferences/1"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/preferences/1' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/preferences/1' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/preferences/1"


            payload <-
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/preferences/1" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/preferences/1")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/preferences:
    post:
      tags:
        - Preference
      summary: Add Preference
      operationId: createPreferences
      description: This API is used to add preference configuration.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Preference'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/preferences \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
            |  \
              http POST https://{baseurl}/api/preferences \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}' \
              --output-document \
              - https://{baseurl}/api/preferences
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/preferences",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Preference: {
                language: 'en',
                date_format: 'yyyy/MM/dd',
                time_format: 'HH:mm',
                time_long_term_format: 'HH:mm:ss',
                time_zone: '25',
                dst1: '0',
                dst2: '0',
                depend_on_os: true,
                user_id: {user_id: 6}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/preferences',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Preference: {
                  language: 'en',
                  date_format: 'yyyy/MM/dd',
                  time_format: 'HH:mm',
                  time_long_term_format: 'HH:mm:ss',
                  time_zone: '25',
                  dst1: '0',
                  dst2: '0',
                  depend_on_os: true,
                  user_id: {user_id: 6}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/preferences");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Preference": {
                "language": "en",
                "date_format": "yyyy/MM/dd",
                "time_format": "HH:mm",
                "time_long_term_format": "HH:mm:ss",
                "time_zone": "25",
                "dst1": "0",
                "dst2": "0",
                "depend_on_os": true,
                "user_id": {
                  "user_id": 6
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/preferences',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Preference: {
                  language: 'en',
                  date_format: 'yyyy/MM/dd',
                  time_format: 'HH:mm',
                  time_long_term_format: 'HH:mm:ss',
                  time_zone: '25',
                  dst1: '0',
                  dst2: '0',
                  depend_on_os: true,
                  user_id: {user_id: 6}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/preferences';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
            };

            fetch('https://{baseurl}/api/preferences', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/preferences",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Preference": {
                "language": "en",
                "date_format": "yyyy/MM/dd",
                "time_format": "HH:mm",
                "time_long_term_format": "HH:mm:ss",
                "time_zone": "25",
                "dst1": "0",
                "dst2": "0",
                "depend_on_os": true,
                "user_id": {
                  "user_id": 6
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/preferences");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/preferences", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/preferences"


            payload = {"Preference": {
                    "language": "en",
                    "date_format": "yyyy/MM/dd",
                    "time_format": "HH:mm",
                    "time_long_term_format": "HH:mm:ss",
                    "time_zone": "25",
                    "dst1": "0",
                    "dst2": "0",
                    "depend_on_os": True,
                    "user_id": {"user_id": 6}
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/preferences")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/preferences",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/preferences');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}');


            $request->setRequestUrl('https://{baseurl}/api/preferences');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/preferences")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/preferences")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/preferences\"\n\n\tpayload := strings.NewReader(\"{\\\"Preference\\\":{\\\"language\\\":\\\"en\\\",\\\"date_format\\\":\\\"yyyy/MM/dd\\\",\\\"time_format\\\":\\\"HH:mm\\\",\\\"time_long_term_format\\\":\\\"HH:mm:ss\\\",\\\"time_zone\\\":\\\"25\\\",\\\"dst1\\\":\\\"0\\\",\\\"dst2\\\":\\\"0\\\",\\\"depend_on_os\\\":true,\\\"user_id\\\":{\\\"user_id\\\":6}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/preferences");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Preference": @{ @"language": @"en",
            @"date_format": @"yyyy/MM/dd", @"time_format": @"HH:mm",
            @"time_long_term_format": @"HH:mm:ss", @"time_zone": @"25", @"dst1":
            @"0", @"dst2": @"0", @"depend_on_os": @YES, @"user_id": @{
            @"user_id": @6 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/preferences"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Preference": [
                "language": "en",
                "date_format": "yyyy/MM/dd",
                "time_format": "HH:mm",
                "time_long_term_format": "HH:mm:ss",
                "time_zone": "25",
                "dst1": "0",
                "dst2": "0",
                "depend_on_os": true,
                "user_id": ["user_id": 6]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/preferences")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/preferences");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/preferences"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/preferences' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/preferences' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Preference":{"language":"en","date_format":"yyyy/MM/dd","time_format":"HH:mm","time_long_term_format":"HH:mm:ss","time_zone":"25","dst1":"0","dst2":"0","depend_on_os":true,"user_id":{"user_id":6}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/preferences"


            payload <-
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/preferences" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Preference\":{\"language\":\"en\",\"date_format\":\"yyyy/MM/dd\",\"time_format\":\"HH:mm\",\"time_long_term_format\":\"HH:mm:ss\",\"time_zone\":\"25\",\"dst1\":\"0\",\"dst2\":\"0\",\"depend_on_os\":true,\"user_id\":{\"user_id\":6}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/preferences")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/setting/custom_fields:
    post:
      tags:
        - Setting
      summary: Create Custom Field(s)
      operationId: createCustomFields
      description: This API is used to create user custom field(s) on BioStar X.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                CustomFieldCollection:
                  $ref: '#/components/schemas/CustomFieldCollection'
              example:
                CustomFieldCollection:
                  rows:
                    - order: 5
                      name: text input box
                      type: 0
                      enable: true
                    - order: 2
                      name: number input
                      type: 1
                      enable: true
                    - order: 3
                      name: combo box
                      type: 2
                      data: abc; def
                      enable: true
                    - order: 4
                      name: file upload
                      type: 3
                      enable: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/setting/custom_fields \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"CustomFieldCollection":{"rows":[{"order":5,"name":"text input box","type":0,"enable":true},{"order":2,"name":"number input","type":1,"enable":true},{"order":3,"name":"combo box","type":2,"data":"abc; def","enable":true},{"order":4,"name":"file upload","type":3,"enable":true}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"CustomFieldCollection":{"rows":[{"order":5,"name":"text
            input box","type":0,"enable":true},{"order":2,"name":"number
            input","type":1,"enable":true},{"order":3,"name":"combo
            box","type":2,"data":"abc;
            def","enable":true},{"order":4,"name":"file
            upload","type":3,"enable":true}]}}' |  \
              http POST https://{baseurl}/api/setting/custom_fields \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"CustomFieldCollection":{"rows":[{"order":5,"name":"text input box","type":0,"enable":true},{"order":2,"name":"number input","type":1,"enable":true},{"order":3,"name":"combo box","type":2,"data":"abc; def","enable":true},{"order":4,"name":"file upload","type":3,"enable":true}]}}' \
              --output-document \
              - https://{baseurl}/api/setting/custom_fields
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/custom_fields",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              CustomFieldCollection: {
                rows: [
                  {order: 5, name: 'text input box', type: 0, enable: true},
                  {order: 2, name: 'number input', type: 1, enable: true},
                  {order: 3, name: 'combo box', type: 2, data: 'abc; def', enable: true},
                  {order: 4, name: 'file upload', type: 3, enable: true}
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/setting/custom_fields',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                CustomFieldCollection: {
                  rows: [
                    {order: 5, name: 'text input box', type: 0, enable: true},
                    {order: 2, name: 'number input', type: 1, enable: true},
                    {order: 3, name: 'combo box', type: 2, data: 'abc; def', enable: true},
                    {order: 4, name: 'file upload', type: 3, enable: true}
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/setting/custom_fields");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "CustomFieldCollection": {
                "rows": [
                  {
                    "order": 5,
                    "name": "text input box",
                    "type": 0,
                    "enable": true
                  },
                  {
                    "order": 2,
                    "name": "number input",
                    "type": 1,
                    "enable": true
                  },
                  {
                    "order": 3,
                    "name": "combo box",
                    "type": 2,
                    "data": "abc; def",
                    "enable": true
                  },
                  {
                    "order": 4,
                    "name": "file upload",
                    "type": 3,
                    "enable": true
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/setting/custom_fields',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                CustomFieldCollection: {
                  rows: [
                    {order: 5, name: 'text input box', type: 0, enable: true},
                    {order: 2, name: 'number input', type: 1, enable: true},
                    {order: 3, name: 'combo box', type: 2, data: 'abc; def', enable: true},
                    {order: 4, name: 'file upload', type: 3, enable: true}
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/setting/custom_fields';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"CustomFieldCollection":{"rows":[{"order":5,"name":"text input box","type":0,"enable":true},{"order":2,"name":"number input","type":1,"enable":true},{"order":3,"name":"combo box","type":2,"data":"abc; def","enable":true},{"order":4,"name":"file upload","type":3,"enable":true}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"CustomFieldCollection":{"rows":[{"order":5,"name":"text input box","type":0,"enable":true},{"order":2,"name":"number input","type":1,"enable":true},{"order":3,"name":"combo box","type":2,"data":"abc; def","enable":true},{"order":4,"name":"file upload","type":3,"enable":true}]}}'
            };

            fetch('https://{baseurl}/api/setting/custom_fields', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/custom_fields",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text input box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo box\",\"type\":2,\"data\":\"abc; def\",\"enable\":true},{\"order\":4,\"name\":\"file upload\",\"type\":3,\"enable\":true}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "CustomFieldCollection": {
                "rows": [
                  {
                    "order": 5,
                    "name": "text input box",
                    "type": 0,
                    "enable": true
                  },
                  {
                    "order": 2,
                    "name": "number input",
                    "type": 1,
                    "enable": true
                  },
                  {
                    "order": 3,
                    "name": "combo box",
                    "type": 2,
                    "data": "abc; def",
                    "enable": true
                  },
                  {
                    "order": 4,
                    "name": "file upload",
                    "type": 3,
                    "enable": true
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/setting/custom_fields");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text
            input
            box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number
            input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\",\"enable\":true},{\"order\":4,\"name\":\"file
            upload\",\"type\":3,\"enable\":true}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/setting/custom_fields", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/setting/custom_fields"


            payload = {"CustomFieldCollection": {"rows": [
                        {
                            "order": 5,
                            "name": "text input box",
                            "type": 0,
                            "enable": True
                        },
                        {
                            "order": 2,
                            "name": "number input",
                            "type": 1,
                            "enable": True
                        },
                        {
                            "order": 3,
                            "name": "combo box",
                            "type": 2,
                            "data": "abc; def",
                            "enable": True
                        },
                        {
                            "order": 4,
                            "name": "file upload",
                            "type": 3,
                            "enable": True
                        }
                    ]}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/setting/custom_fields")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text
            input
            box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number
            input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\",\"enable\":true},{\"order\":4,\"name\":\"file
            upload\",\"type\":3,\"enable\":true}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/custom_fields",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text input box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo box\",\"type\":2,\"data\":\"abc; def\",\"enable\":true},{\"order\":4,\"name\":\"file upload\",\"type\":3,\"enable\":true}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/setting/custom_fields');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"CustomFieldCollection":{"rows":[{"order":5,"name":"text
            input box","type":0,"enable":true},{"order":2,"name":"number
            input","type":1,"enable":true},{"order":3,"name":"combo
            box","type":2,"data":"abc;
            def","enable":true},{"order":4,"name":"file
            upload","type":3,"enable":true}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"CustomFieldCollection":{"rows":[{"order":5,"name":"text
            input box","type":0,"enable":true},{"order":2,"name":"number
            input","type":1,"enable":true},{"order":3,"name":"combo
            box","type":2,"data":"abc;
            def","enable":true},{"order":4,"name":"file
            upload","type":3,"enable":true}]}}');


            $request->setRequestUrl('https://{baseurl}/api/setting/custom_fields');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text
            input
            box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number
            input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\",\"enable\":true},{\"order\":4,\"name\":\"file
            upload\",\"type\":3,\"enable\":true}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/custom_fields")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/setting/custom_fields")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text input box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo box\",\"type\":2,\"data\":\"abc; def\",\"enable\":true},{\"order\":4,\"name\":\"file upload\",\"type\":3,\"enable\":true}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/custom_fields\"\n\n\tpayload := strings.NewReader(\"{\\\"CustomFieldCollection\\\":{\\\"rows\\\":[{\\\"order\\\":5,\\\"name\\\":\\\"text input box\\\",\\\"type\\\":0,\\\"enable\\\":true},{\\\"order\\\":2,\\\"name\\\":\\\"number input\\\",\\\"type\\\":1,\\\"enable\\\":true},{\\\"order\\\":3,\\\"name\\\":\\\"combo box\\\",\\\"type\\\":2,\\\"data\\\":\\\"abc; def\\\",\\\"enable\\\":true},{\\\"order\\\":4,\\\"name\\\":\\\"file upload\\\",\\\"type\\\":3,\\\"enable\\\":true}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/custom_fields");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text
            input
            box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number
            input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\",\"enable\":true},{\"order\":4,\"name\":\"file
            upload\",\"type\":3,\"enable\":true}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"CustomFieldCollection": @{ @"rows":
            @[ @{ @"order": @5, @"name": @"text input box", @"type": @0,
            @"enable": @YES }, @{ @"order": @2, @"name": @"number input",
            @"type": @1, @"enable": @YES }, @{ @"order": @3, @"name": @"combo
            box", @"type": @2, @"data": @"abc; def", @"enable": @YES }, @{
            @"order": @4, @"name": @"file upload", @"type": @3, @"enable": @YES
            } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/custom_fields"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["CustomFieldCollection": ["rows": [
                  [
                    "order": 5,
                    "name": "text input box",
                    "type": 0,
                    "enable": true
                  ],
                  [
                    "order": 2,
                    "name": "number input",
                    "type": 1,
                    "enable": true
                  ],
                  [
                    "order": 3,
                    "name": "combo box",
                    "type": 2,
                    "data": "abc; def",
                    "enable": true
                  ],
                  [
                    "order": 4,
                    "name": "file upload",
                    "type": 3,
                    "enable": true
                  ]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/custom_fields")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/custom_fields");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text
            input
            box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number
            input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\",\"enable\":true},{\"order\":4,\"name\":\"file
            upload\",\"type\":3,\"enable\":true}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/setting/custom_fields"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text input box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo box\",\"type\":2,\"data\":\"abc; def\",\"enable\":true},{\"order\":4,\"name\":\"file upload\",\"type\":3,\"enable\":true}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/custom_fields' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"CustomFieldCollection":{"rows":[{"order":5,"name":"text input
            box","type":0,"enable":true},{"order":2,"name":"number
            input","type":1,"enable":true},{"order":3,"name":"combo
            box","type":2,"data":"abc;
            def","enable":true},{"order":4,"name":"file
            upload","type":3,"enable":true}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/custom_fields' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"CustomFieldCollection":{"rows":[{"order":5,"name":"text input
            box","type":0,"enable":true},{"order":2,"name":"number
            input","type":1,"enable":true},{"order":3,"name":"combo
            box","type":2,"data":"abc;
            def","enable":true},{"order":4,"name":"file
            upload","type":3,"enable":true}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/custom_fields"


            payload <-
            "{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text
            input
            box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number
            input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\",\"enable\":true},{\"order\":4,\"name\":\"file
            upload\",\"type\":3,\"enable\":true}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting/custom_fields" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text
            input
            box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number
            input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\",\"enable\":true},{\"order\":4,\"name\":\"file
            upload\",\"type\":3,\"enable\":true}]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"CustomFieldCollection\":{\"rows\":[{\"order\":5,\"name\":\"text
            input
            box\",\"type\":0,\"enable\":true},{\"order\":2,\"name\":\"number
            input\",\"type\":1,\"enable\":true},{\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\",\"enable\":true},{\"order\":4,\"name\":\"file
            upload\",\"type\":3,\"enable\":true}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/custom_fields")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    put:
      tags:
        - Setting
      summary: Update Custom Field(s)
      operationId: updateCustomFields
      description: >-
        This example shows how to update custom field.


        **Note:**


        - The main difference between Create and Updating custom field(s) is on
        Update, ID needs to be specified.

        - To get the custom field's ID, use `GET /api/setting/custom_fields`

        - When updating a custom field when there are more than 1 custom fields,
        the custom fields which are not updated need to be specified since the
        API is using `PUT` method.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                CustomFieldCollection:
                  $ref: '#/components/schemas/CustomFieldCollection'
              example:
                CustomFieldCollection:
                  rows:
                    - id: 1
                      order: 1
                      name: text input box
                      type: 0
                    - id: 2
                      order: 2
                      name: number input
                      type: 1
                    - id: 3
                      order: 3
                      name: combo box
                      type: 2
                      data: abc; def
                    - id: 4
                      order: 4
                      name: file upload
                      type: 3
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/setting/custom_fields \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"CustomFieldCollection":{"rows":[{"id":1,"order":1,"name":"text input box","type":0},{"id":2,"order":2,"name":"number input","type":1},{"id":3,"order":3,"name":"combo box","type":2,"data":"abc; def"},{"id":4,"order":4,"name":"file upload","type":3}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"CustomFieldCollection":{"rows":[{"id":1,"order":1,"name":"text
            input box","type":0},{"id":2,"order":2,"name":"number
            input","type":1},{"id":3,"order":3,"name":"combo
            box","type":2,"data":"abc; def"},{"id":4,"order":4,"name":"file
            upload","type":3}]}}' |  \
              http PUT https://{baseurl}/api/setting/custom_fields \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"CustomFieldCollection":{"rows":[{"id":1,"order":1,"name":"text input box","type":0},{"id":2,"order":2,"name":"number input","type":1},{"id":3,"order":3,"name":"combo box","type":2,"data":"abc; def"},{"id":4,"order":4,"name":"file upload","type":3}]}}' \
              --output-document \
              - https://{baseurl}/api/setting/custom_fields
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/custom_fields",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              CustomFieldCollection: {
                rows: [
                  {id: 1, order: 1, name: 'text input box', type: 0},
                  {id: 2, order: 2, name: 'number input', type: 1},
                  {id: 3, order: 3, name: 'combo box', type: 2, data: 'abc; def'},
                  {id: 4, order: 4, name: 'file upload', type: 3}
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting/custom_fields',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                CustomFieldCollection: {
                  rows: [
                    {id: 1, order: 1, name: 'text input box', type: 0},
                    {id: 2, order: 2, name: 'number input', type: 1},
                    {id: 3, order: 3, name: 'combo box', type: 2, data: 'abc; def'},
                    {id: 4, order: 4, name: 'file upload', type: 3}
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/setting/custom_fields");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "CustomFieldCollection": {
                "rows": [
                  {
                    "id": 1,
                    "order": 1,
                    "name": "text input box",
                    "type": 0
                  },
                  {
                    "id": 2,
                    "order": 2,
                    "name": "number input",
                    "type": 1
                  },
                  {
                    "id": 3,
                    "order": 3,
                    "name": "combo box",
                    "type": 2,
                    "data": "abc; def"
                  },
                  {
                    "id": 4,
                    "order": 4,
                    "name": "file upload",
                    "type": 3
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting/custom_fields',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                CustomFieldCollection: {
                  rows: [
                    {id: 1, order: 1, name: 'text input box', type: 0},
                    {id: 2, order: 2, name: 'number input', type: 1},
                    {id: 3, order: 3, name: 'combo box', type: 2, data: 'abc; def'},
                    {id: 4, order: 4, name: 'file upload', type: 3}
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/setting/custom_fields';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"CustomFieldCollection":{"rows":[{"id":1,"order":1,"name":"text input box","type":0},{"id":2,"order":2,"name":"number input","type":1},{"id":3,"order":3,"name":"combo box","type":2,"data":"abc; def"},{"id":4,"order":4,"name":"file upload","type":3}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"CustomFieldCollection":{"rows":[{"id":1,"order":1,"name":"text input box","type":0},{"id":2,"order":2,"name":"number input","type":1},{"id":3,"order":3,"name":"combo box","type":2,"data":"abc; def"},{"id":4,"order":4,"name":"file upload","type":3}]}}'
            };

            fetch('https://{baseurl}/api/setting/custom_fields', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/custom_fields",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo box\",\"type\":2,\"data\":\"abc; def\"},{\"id\":4,\"order\":4,\"name\":\"file upload\",\"type\":3}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "CustomFieldCollection": {
                "rows": [
                  {
                    "id": 1,
                    "order": 1,
                    "name": "text input box",
                    "type": 0
                  },
                  {
                    "id": 2,
                    "order": 2,
                    "name": "number input",
                    "type": 1
                  },
                  {
                    "id": 3,
                    "order": 3,
                    "name": "combo box",
                    "type": 2,
                    "data": "abc; def"
                  },
                  {
                    "id": 4,
                    "order": 4,
                    "name": "file upload",
                    "type": 3
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/setting/custom_fields");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text
            input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number
            input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\"},{\"id\":4,\"order\":4,\"name\":\"file
            upload\",\"type\":3}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/setting/custom_fields", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/setting/custom_fields"


            payload = {"CustomFieldCollection": {"rows": [
                        {
                            "id": 1,
                            "order": 1,
                            "name": "text input box",
                            "type": 0
                        },
                        {
                            "id": 2,
                            "order": 2,
                            "name": "number input",
                            "type": 1
                        },
                        {
                            "id": 3,
                            "order": 3,
                            "name": "combo box",
                            "type": 2,
                            "data": "abc; def"
                        },
                        {
                            "id": 4,
                            "order": 4,
                            "name": "file upload",
                            "type": 3
                        }
                    ]}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/setting/custom_fields")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text
            input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number
            input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\"},{\"id\":4,\"order\":4,\"name\":\"file
            upload\",\"type\":3}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/custom_fields",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo box\",\"type\":2,\"data\":\"abc; def\"},{\"id\":4,\"order\":4,\"name\":\"file upload\",\"type\":3}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/setting/custom_fields');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"CustomFieldCollection":{"rows":[{"id":1,"order":1,"name":"text
            input box","type":0},{"id":2,"order":2,"name":"number
            input","type":1},{"id":3,"order":3,"name":"combo
            box","type":2,"data":"abc; def"},{"id":4,"order":4,"name":"file
            upload","type":3}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"CustomFieldCollection":{"rows":[{"id":1,"order":1,"name":"text
            input box","type":0},{"id":2,"order":2,"name":"number
            input","type":1},{"id":3,"order":3,"name":"combo
            box","type":2,"data":"abc; def"},{"id":4,"order":4,"name":"file
            upload","type":3}]}}');


            $request->setRequestUrl('https://{baseurl}/api/setting/custom_fields');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text
            input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number
            input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\"},{\"id\":4,\"order\":4,\"name\":\"file
            upload\",\"type\":3}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/custom_fields")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/setting/custom_fields")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo box\",\"type\":2,\"data\":\"abc; def\"},{\"id\":4,\"order\":4,\"name\":\"file upload\",\"type\":3}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/custom_fields\"\n\n\tpayload := strings.NewReader(\"{\\\"CustomFieldCollection\\\":{\\\"rows\\\":[{\\\"id\\\":1,\\\"order\\\":1,\\\"name\\\":\\\"text input box\\\",\\\"type\\\":0},{\\\"id\\\":2,\\\"order\\\":2,\\\"name\\\":\\\"number input\\\",\\\"type\\\":1},{\\\"id\\\":3,\\\"order\\\":3,\\\"name\\\":\\\"combo box\\\",\\\"type\\\":2,\\\"data\\\":\\\"abc; def\\\"},{\\\"id\\\":4,\\\"order\\\":4,\\\"name\\\":\\\"file upload\\\",\\\"type\\\":3}]}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/custom_fields");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text
            input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number
            input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\"},{\"id\":4,\"order\":4,\"name\":\"file
            upload\",\"type\":3}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"CustomFieldCollection": @{ @"rows":
            @[ @{ @"id": @1, @"order": @1, @"name": @"text input box", @"type":
            @0 }, @{ @"id": @2, @"order": @2, @"name": @"number input", @"type":
            @1 }, @{ @"id": @3, @"order": @3, @"name": @"combo box", @"type":
            @2, @"data": @"abc; def" }, @{ @"id": @4, @"order": @4, @"name":
            @"file upload", @"type": @3 } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/custom_fields"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["CustomFieldCollection": ["rows": [
                  [
                    "id": 1,
                    "order": 1,
                    "name": "text input box",
                    "type": 0
                  ],
                  [
                    "id": 2,
                    "order": 2,
                    "name": "number input",
                    "type": 1
                  ],
                  [
                    "id": 3,
                    "order": 3,
                    "name": "combo box",
                    "type": 2,
                    "data": "abc; def"
                  ],
                  [
                    "id": 4,
                    "order": 4,
                    "name": "file upload",
                    "type": 3
                  ]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/custom_fields")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/custom_fields");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text
            input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number
            input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\"},{\"id\":4,\"order\":4,\"name\":\"file
            upload\",\"type\":3}]}}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/setting/custom_fields"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo box\",\"type\":2,\"data\":\"abc; def\"},{\"id\":4,\"order\":4,\"name\":\"file upload\",\"type\":3}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/custom_fields' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"CustomFieldCollection":{"rows":[{"id":1,"order":1,"name":"text
            input box","type":0},{"id":2,"order":2,"name":"number
            input","type":1},{"id":3,"order":3,"name":"combo
            box","type":2,"data":"abc; def"},{"id":4,"order":4,"name":"file
            upload","type":3}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/custom_fields' -Method PUT -Headers
            $headers -ContentType 'application/json' -Body
            '{"CustomFieldCollection":{"rows":[{"id":1,"order":1,"name":"text
            input box","type":0},{"id":2,"order":2,"name":"number
            input","type":1},{"id":3,"order":3,"name":"combo
            box","type":2,"data":"abc; def"},{"id":4,"order":4,"name":"file
            upload","type":3}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/custom_fields"


            payload <-
            "{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text
            input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number
            input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\"},{\"id\":4,\"order\":4,\"name\":\"file
            upload\",\"type\":3}]}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting/custom_fields" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text
            input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number
            input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\"},{\"id\":4,\"order\":4,\"name\":\"file
            upload\",\"type\":3}]}}" in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"CustomFieldCollection\":{\"rows\":[{\"id\":1,\"order\":1,\"name\":\"text
            input box\",\"type\":0},{\"id\":2,\"order\":2,\"name\":\"number
            input\",\"type\":1},{\"id\":3,\"order\":3,\"name\":\"combo
            box\",\"type\":2,\"data\":\"abc;
            def\"},{\"id\":4,\"order\":4,\"name\":\"file
            upload\",\"type\":3}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/custom_fields")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Setting
      summary: Delete Custom Field(s)
      operationId: deleteCustomFields
      description: >-
        This API is used to delete user custom fields which recorded on BioStar
        X.
      parameters:
        - name: id
          in: query
          schema:
            type: string
          description: >-
            ID of the Custom Field(s) which will be deleted. Use space ( ) as
            separator for multiple IDs.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http DELETE
            'https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/setting/custom_fields',
              qs: {id: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/setting/custom_fields");


            req.query({
              "id": "SOME_STRING_VALUE"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/setting/custom_fields',
              params: {id: 'SOME_STRING_VALUE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("DELETE",
            "https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE",
            "{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/setting/custom_fields"


            querystring = {"id":"SOME_STRING_VALUE"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Delete.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/setting/custom_fields');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/setting/custom_fields');

            $request->setRequestMethod('DELETE');

            $request->setQuery(new http\QueryString([
              'id' => 'SOME_STRING_VALUE'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE'
            -Method DELETE -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE'
            -Method DELETE -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/custom_fields"


            queryString <- list([ 'id' ] = "SOME_STRING_VALUE")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/custom_fields?id=SOME_STRING_VALUE")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Setting
      summary: List Available Custom Field(s)
      operationId: listCustomFields
      description: This API is used to view all available user custom fields.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  CustomFieldCollection:
                    type: object
                    properties:
                      total:
                        type: integer
                        description: Total of Custom Fields
                      rows:
                        type: array
                        description: List of Custom Fields definition
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: ID of the Custom Field
                            name:
                              type: string
                              description: Name of the Custom Field
                            type:
                              type: integer
                              description: |-
                                Type of the Custom Field.
                                - `0` = Text Input
                                - `1` = Number Input
                                - `2` = Combo Box
                                - `3` = File Upload
                            order:
                              type: integer
                              description: Display order of the Custom Field
                            data:
                              type: string
                              description: >-
                                Only for Combo Box Type. Data for combo box
                                options, delimited by semicolon.
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
              example:
                CustomFieldCollection:
                  total: 5
                  rows:
                    - id: 1
                      name: combo box 1
                      type: 2
                      order: 1
                      data: 1; 2; 3
                    - id: 3
                      name: number input
                      type: 1
                      order: 2
                    - id: 4
                      name: combo box 2
                      type: 2
                      order: 3
                      data: Option 1; Option 2
                    - id: 5
                      name: file upload
                      type: 3
                      order: 4
                    - id: 2
                      name: text input box
                      type: 0
                      order: 5
                Response:
                  code: '0'
                  link: https://support.supremainc.com/en/support/home
                  message: Success
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/setting/custom_fields \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/setting/custom_fields \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/setting/custom_fields
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/custom_fields",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/setting/custom_fields',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/setting/custom_fields");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/setting/custom_fields',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/setting/custom_fields';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/setting/custom_fields', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/custom_fields",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/setting/custom_fields");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/setting/custom_fields",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/setting/custom_fields"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/setting/custom_fields")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/custom_fields",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/setting/custom_fields');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/setting/custom_fields');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/custom_fields")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/setting/custom_fields")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/custom_fields\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/custom_fields");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/custom_fields"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/custom_fields")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/custom_fields");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/setting/custom_fields"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/custom_fields' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/custom_fields' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/custom_fields"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting/custom_fields" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/custom_fields")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/setting/output_signals:
    get:
      tags:
        - Setting
      summary: View Output Signal
      operationId: listOutputSignals
      description: >-
        This API is used to view output signals which used on certain actions
        for setting the relay of the device to trigger in certain signals. The
        trigger & action from the device configuration is one of them.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/setting/output_signals \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/setting/output_signals \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/setting/output_signals
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/output_signals",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/setting/output_signals',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/setting/output_signals");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/setting/output_signals',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/setting/output_signals';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/setting/output_signals', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/output_signals",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/setting/output_signals");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/setting/output_signals",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/setting/output_signals"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/setting/output_signals")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/output_signals",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/setting/output_signals');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/setting/output_signals');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/output_signals")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/setting/output_signals")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/output_signals\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/output_signals");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/output_signals"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/output_signals")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/output_signals");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/setting/output_signals"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/output_signals' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/output_signals' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/output_signals"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting/output_signals" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/output_signals")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    post:
      tags:
        - Setting
      summary: Create Output Signal
      operationId: createOutputSignals
      description: This API is used to create output signal.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                OutputSignal:
                  type: object
                  required:
                    - name
                  properties:
                    name:
                      type: string
                      description: Name of the output signal
                      example: TestElevatorSignal2
                    delay:
                      type: integer
                      description: Set the signal delay
                      example: 0
                    count:
                      type: integer
                      description: Set the signal count
                      example: 0
                    on_duration:
                      type: integer
                      description: Set the signal ON duration
                      example: 0
                    off_duration:
                      type: integer
                      description: Set the signal OFF duration
                      example: 0
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/setting/output_signals \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"OutputSignal":{"name":"TestElevatorSignal2","delay":0,"count":0,"on_duration":0,"off_duration":0}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"OutputSignal":{"name":"TestElevatorSignal2","delay":0,"count":0,"on_duration":0,"off_duration":0}}'
            |  \
              http POST https://{baseurl}/api/setting/output_signals \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"OutputSignal":{"name":"TestElevatorSignal2","delay":0,"count":0,"on_duration":0,"off_duration":0}}' \
              --output-document \
              - https://{baseurl}/api/setting/output_signals
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/output_signals",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              OutputSignal: {
                name: 'TestElevatorSignal2',
                delay: 0,
                count: 0,
                on_duration: 0,
                off_duration: 0
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/setting/output_signals',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                OutputSignal: {
                  name: 'TestElevatorSignal2',
                  delay: 0,
                  count: 0,
                  on_duration: 0,
                  off_duration: 0
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/setting/output_signals");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "OutputSignal": {
                "name": "TestElevatorSignal2",
                "delay": 0,
                "count": 0,
                "on_duration": 0,
                "off_duration": 0
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/setting/output_signals',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                OutputSignal: {
                  name: 'TestElevatorSignal2',
                  delay: 0,
                  count: 0,
                  on_duration: 0,
                  off_duration: 0
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/setting/output_signals';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"OutputSignal":{"name":"TestElevatorSignal2","delay":0,"count":0,"on_duration":0,"off_duration":0}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"OutputSignal":{"name":"TestElevatorSignal2","delay":0,"count":0,"on_duration":0,"off_duration":0}}'
            };

            fetch('https://{baseurl}/api/setting/output_signals', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/output_signals",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "OutputSignal": {
                "name": "TestElevatorSignal2",
                "delay": 0,
                "count": 0,
                "on_duration": 0,
                "off_duration": 0
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/setting/output_signals");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/setting/output_signals",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/setting/output_signals"


            payload = {"OutputSignal": {
                    "name": "TestElevatorSignal2",
                    "delay": 0,
                    "count": 0,
                    "on_duration": 0,
                    "off_duration": 0
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/setting/output_signals")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/output_signals",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/setting/output_signals');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"OutputSignal":{"name":"TestElevatorSignal2","delay":0,"count":0,"on_duration":0,"off_duration":0}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"OutputSignal":{"name":"TestElevatorSignal2","delay":0,"count":0,"on_duration":0,"off_duration":0}}');


            $request->setRequestUrl('https://{baseurl}/api/setting/output_signals');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/output_signals")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/setting/output_signals")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/output_signals\"\n\n\tpayload := strings.NewReader(\"{\\\"OutputSignal\\\":{\\\"name\\\":\\\"TestElevatorSignal2\\\",\\\"delay\\\":0,\\\"count\\\":0,\\\"on_duration\\\":0,\\\"off_duration\\\":0}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/output_signals");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"OutputSignal": @{ @"name":
            @"TestElevatorSignal2", @"delay": @0, @"count": @0, @"on_duration":
            @0, @"off_duration": @0 } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/output_signals"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["OutputSignal": [
                "name": "TestElevatorSignal2",
                "delay": 0,
                "count": 0,
                "on_duration": 0,
                "off_duration": 0
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/output_signals")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/output_signals");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/setting/output_signals"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/output_signals' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"OutputSignal":{"name":"TestElevatorSignal2","delay":0,"count":0,"on_duration":0,"off_duration":0}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/output_signals' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"OutputSignal":{"name":"TestElevatorSignal2","delay":0,"count":0,"on_duration":0,"off_duration":0}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/output_signals"


            payload <-
            "{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting/output_signals" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"OutputSignal\":{\"name\":\"TestElevatorSignal2\",\"delay\":0,\"count\":0,\"on_duration\":0,\"off_duration\":0}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/output_signals")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/setting/output_signals/{id}:
    put:
      tags:
        - Setting
      summary: Update Output Signal
      operationId: updateOutputSignals
      description: This API is used to update output signal.
      requestBody:
        content: {}
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the output signal which will be updated.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/setting/output_signals/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http PUT https://{baseurl}/api/setting/output_signals/{id} \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/setting/output_signals/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/output_signals/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting/output_signals/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/setting/output_signals/{id}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting/output_signals/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/setting/output_signals/{id}';


            let options = {method: 'PUT', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'PUT', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/setting/output_signals/{id}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/output_signals/{id}",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("PUT",
            "https://{baseurl}/api/setting/output_signals/{id}");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("PUT", "{baseurl}/api/setting/output_signals/{id}",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/setting/output_signals/{id}"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("PUT", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/setting/output_signals/{id}")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Put.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/output_signals/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/setting/output_signals/{id}');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/setting/output_signals/{id}');

            $request->setRequestMethod('PUT');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/output_signals/{id}")
              .put(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/setting/output_signals/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/output_signals/{id}\"\n\n\treq, _ := http.NewRequest(\"PUT\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/output_signals/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/output_signals/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/output_signals/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/output_signals/{id}");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/setting/output_signals/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/output_signals/{id}' -Method PUT
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/output_signals/{id}' -Method PUT
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/output_signals/{id}"


            response <- VERB("PUT", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting/output_signals/{id}" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/output_signals/{id}")
              .put(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Setting
      summary: Delete Output Signal
      operationId: deleteOutputSignals
      description: This API is used to delete output signal.
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the output signal which will be deleted.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url https://{baseurl}/api/setting/output_signals/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE https://{baseurl}/api/setting/output_signals/{id} \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/setting/output_signals/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/output_signals/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/setting/output_signals/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/setting/output_signals/{id}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/setting/output_signals/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/setting/output_signals/{id}';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/setting/output_signals/{id}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/output_signals/{id}",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("DELETE",
            "https://{baseurl}/api/setting/output_signals/{id}");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/setting/output_signals/{id}",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/setting/output_signals/{id}"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("DELETE", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/setting/output_signals/{id}")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/output_signals/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/setting/output_signals/{id}');

            $request->setMethod(HTTP_METH_DELETE);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/setting/output_signals/{id}');

            $request->setRequestMethod('DELETE');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/output_signals/{id}")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/setting/output_signals/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/output_signals/{id}\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/output_signals/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/output_signals/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/output_signals/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/output_signals/{id}");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/setting/output_signals/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/output_signals/{id}' -Method DELETE
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/output_signals/{id}' -Method DELETE
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/output_signals/{id}"


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting/output_signals/{id}" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/output_signals/{id}")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/setting/biostar/server_matching:
    put:
      tags:
        - Setting
      summary: Update Server Matching
      operationId: updateBiostarServerMatching
      description: >-
        If server matching enabled, the user’s fingerprint will be matched from
        BioStar X, not the device. The Server Matching can be used when the
        corresponding license is activated.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                BioStar:
                  type: object
                  properties:
                    server_matching:
                      $ref: '#/components/schemas/ServerMatching'
              example:
                BioStar:
                  server_matching:
                    use-server-matching: false
                    security-level: 6
                    face-security-level: 1
                    fast-mode: true
                    matching-concurrency-count: 2
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/setting/biostar/server_matching \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"BioStar":{"server_matching":{"use-server-matching":false,"security-level":6,"face-security-level":1,"fast-mode":true,"matching-concurrency-count":2}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"BioStar":{"server_matching":{"use-server-matching":false,"security-level":6,"face-security-level":1,"fast-mode":true,"matching-concurrency-count":2}}}'
            |  \
              http PUT https://{baseurl}/api/setting/biostar/server_matching \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"BioStar":{"server_matching":{"use-server-matching":false,"security-level":6,"face-security-level":1,"fast-mode":true,"matching-concurrency-count":2}}}' \
              --output-document \
              - https://{baseurl}/api/setting/biostar/server_matching
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/setting/biostar/server_matching",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              BioStar: {
                server_matching: {
                  'use-server-matching': false,
                  'security-level': 6,
                  'face-security-level': 1,
                  'fast-mode': true,
                  'matching-concurrency-count': 2
                }
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting/biostar/server_matching',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                BioStar: {
                  server_matching: {
                    'use-server-matching': false,
                    'security-level': 6,
                    'face-security-level': 1,
                    'fast-mode': true,
                    'matching-concurrency-count': 2
                  }
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/setting/biostar/server_matching");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "BioStar": {
                "server_matching": {
                  "use-server-matching": false,
                  "security-level": 6,
                  "face-security-level": 1,
                  "fast-mode": true,
                  "matching-concurrency-count": 2
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/setting/biostar/server_matching',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                BioStar: {
                  server_matching: {
                    'use-server-matching': false,
                    'security-level': 6,
                    'face-security-level': 1,
                    'fast-mode': true,
                    'matching-concurrency-count': 2
                  }
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/setting/biostar/server_matching';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"BioStar":{"server_matching":{"use-server-matching":false,"security-level":6,"face-security-level":1,"fast-mode":true,"matching-concurrency-count":2}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"BioStar":{"server_matching":{"use-server-matching":false,"security-level":6,"face-security-level":1,"fast-mode":true,"matching-concurrency-count":2}}}'
            };


            fetch('https://{baseurl}/api/setting/biostar/server_matching',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/setting/biostar/server_matching",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "BioStar": {
                "server_matching": {
                  "use-server-matching": false,
                  "security-level": 6,
                  "face-security-level": 1,
                  "fast-mode": true,
                  "matching-concurrency-count": 2
                }
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("PUT",
            "https://{baseurl}/api/setting/biostar/server_matching");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/setting/biostar/server_matching",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/setting/biostar/server_matching"


            payload = {"BioStar": {"server_matching": {
                        "use-server-matching": False,
                        "security-level": 6,
                        "face-security-level": 1,
                        "fast-mode": True,
                        "matching-concurrency-count": 2
                    }}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/setting/biostar/server_matching")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/setting/biostar/server_matching",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/setting/biostar/server_matching');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"BioStar":{"server_matching":{"use-server-matching":false,"security-level":6,"face-security-level":1,"fast-mode":true,"matching-concurrency-count":2}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"BioStar":{"server_matching":{"use-server-matching":false,"security-level":6,"face-security-level":1,"fast-mode":true,"matching-concurrency-count":2}}}');


            $request->setRequestUrl('https://{baseurl}/api/setting/biostar/server_matching');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/setting/biostar/server_matching")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/setting/biostar/server_matching")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/setting/biostar/server_matching\"\n\n\tpayload := strings.NewReader(\"{\\\"BioStar\\\":{\\\"server_matching\\\":{\\\"use-server-matching\\\":false,\\\"security-level\\\":6,\\\"face-security-level\\\":1,\\\"fast-mode\\\":true,\\\"matching-concurrency-count\\\":2}}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/setting/biostar/server_matching");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"BioStar": @{ @"server_matching": @{
            @"use-server-matching": @NO, @"security-level": @6,
            @"face-security-level": @1, @"fast-mode": @YES,
            @"matching-concurrency-count": @2 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/setting/biostar/server_matching"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["BioStar": ["server_matching": [
                  "use-server-matching": false,
                  "security-level": 6,
                  "face-security-level": 1,
                  "fast-mode": true,
                  "matching-concurrency-count": 2
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/setting/biostar/server_matching")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/setting/biostar/server_matching");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/setting/biostar/server_matching"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/setting/biostar/server_matching' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"BioStar":{"server_matching":{"use-server-matching":false,"security-level":6,"face-security-level":1,"fast-mode":true,"matching-concurrency-count":2}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/setting/biostar/server_matching' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"BioStar":{"server_matching":{"use-server-matching":false,"security-level":6,"face-security-level":1,"fast-mode":true,"matching-concurrency-count":2}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/setting/biostar/server_matching"


            payload <-
            "{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/setting/biostar/server_matching" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"BioStar\":{\"server_matching\":{\"use-server-matching\":false,\"security-level\":6,\"face-security-level\":1,\"fast-mode\":true,\"matching-concurrency-count\":2}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/setting/biostar/server_matching")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /js/info.json:
    get:
      tags:
        - Setting
      summary: Check BioStar X Version
      operationId: checkbiostarxversion
      description: This API is used to check BioStar X's version.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/js/info.json \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/js/info.json \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/js/info.json
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/js/info.json",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/js/info.json',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/js/info.json");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/js/info.json',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/js/info.json';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/js/info.json', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/js/info.json",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/js/info.json");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/js/info.json", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/js/info.json"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/js/info.json")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/js/info.json",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/js/info.json');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/js/info.json');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/js/info.json")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/js/info.json")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/js/info.json\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/js/info.json");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/js/info.json"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/js/info.json")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/js/info.json");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/js/info.json"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/js/info.json'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/js/info.json'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/js/info.json"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/js/info.json" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/js/info.json")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/mobile/delete:
    post:
      tags:
        - Mobile Access
      summary: 'Delete Mobile Access Card in Airfob Portal: ALL on User ID'
      operationId: createMobileDelete
      description: >-
        This API is used to delete Mobile Access Card in Airfob Portal.


        There are three variations in using this API:


        1. Using Card ID
            
        2. Using User ID
            
        3. Using ALL parameter on User ID


        - To delete multiple `card_id` or `user_id`, separate each value with
        comma (,). Ex: \["1", "2", "3"\]
            
        - This API only remove Mobile Access Card information from Airfob
        Portal. To remove Mobile Access credential from the user, use `PUT
        /api/users/:id`
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                MobileCollection:
                  type: object
                  properties:
                    mobile:
                      type: object
                      properties:
                        user_id:
                          type: string
                          description: >-
                            The use of ALL parameter will remove Airfob's Mobile
                            Access Card from all user which have Mobile Access
                            Card on their credential list.
                          example: ALL
                        card_id:
                          type: array
                          items:
                            type: string
                          description: List of Mobile Access Card's card ID.
                          example:
                            - '1'
                            - '2'
                            - '3'
                        param:
                          type: object
                          properties:
                            UserIDs:
                              type: string
                              description: >-
                                Will only be required if using ALL parameter on
                                `mobile:user_id`.
                              default: ALL
                            query:
                              type: object
                              properties:
                                group_id:
                                  type: integer
                                  description: >-
                                    Will only be required if using ALL parameter
                                    on `mobile:user_id`.
                                  default: 1
                                  example: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  failedUsers:
                    type: array
                    items:
                      type: string
                    description: >-
                      User information that fails after requesting to delete
                      airfob
                    example: []
                  failedCards:
                    type: array
                    items:
                      type: string
                    description: >-
                      Card information that fails after requesting to delete
                      airfob
                    example: []
                  mobileUsers:
                    type: array
                    items:
                      type: string
                    description: >-
                      List of User IDs which Mobile Access Card deleted
                      successfully
                    example:
                      - '3'
                      - '4'
                  status:
                    type: integer
                    example: 0
                  errorMessage:
                    type: string
                    example: ''
                  Response:
                    $ref: '#/components/schemas/ApiResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/mobile/delete \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"MobileCollection":{"mobile":{"user_id":"ALL","card_id":["1","2","3"],"param":{"UserIDs":"ALL","query":{"group_id":1}}}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"MobileCollection":{"mobile":{"user_id":"ALL","card_id":["1","2","3"],"param":{"UserIDs":"ALL","query":{"group_id":1}}}}}'
            |  \
              http POST https://{baseurl}/api/v2/mobile/delete \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"MobileCollection":{"mobile":{"user_id":"ALL","card_id":["1","2","3"],"param":{"UserIDs":"ALL","query":{"group_id":1}}}}}' \
              --output-document \
              - https://{baseurl}/api/v2/mobile/delete
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/mobile/delete",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              MobileCollection: {
                mobile: {
                  user_id: 'ALL',
                  card_id: ['1', '2', '3'],
                  param: {UserIDs: 'ALL', query: {group_id: 1}}
                }
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/mobile/delete',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                MobileCollection: {
                  mobile: {
                    user_id: 'ALL',
                    card_id: ['1', '2', '3'],
                    param: {UserIDs: 'ALL', query: {group_id: 1}}
                  }
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/mobile/delete");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "MobileCollection": {
                "mobile": {
                  "user_id": "ALL",
                  "card_id": [
                    "1",
                    "2",
                    "3"
                  ],
                  "param": {
                    "UserIDs": "ALL",
                    "query": {
                      "group_id": 1
                    }
                  }
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/mobile/delete',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                MobileCollection: {
                  mobile: {
                    user_id: 'ALL',
                    card_id: ['1', '2', '3'],
                    param: {UserIDs: 'ALL', query: {group_id: 1}}
                  }
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/mobile/delete';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"MobileCollection":{"mobile":{"user_id":"ALL","card_id":["1","2","3"],"param":{"UserIDs":"ALL","query":{"group_id":1}}}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"MobileCollection":{"mobile":{"user_id":"ALL","card_id":["1","2","3"],"param":{"UserIDs":"ALL","query":{"group_id":1}}}}}'
            };

            fetch('https://{baseurl}/api/v2/mobile/delete', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/mobile/delete",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "MobileCollection": {
                "mobile": {
                  "user_id": "ALL",
                  "card_id": [
                    "1",
                    "2",
                    "3"
                  ],
                  "param": {
                    "UserIDs": "ALL",
                    "query": {
                      "group_id": 1
                    }
                  }
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/mobile/delete");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/mobile/delete", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/mobile/delete"


            payload = {"MobileCollection": {"mobile": {
                        "user_id": "ALL",
                        "card_id": ["1", "2", "3"],
                        "param": {
                            "UserIDs": "ALL",
                            "query": {"group_id": 1}
                        }
                    }}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/mobile/delete")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/mobile/delete",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/mobile/delete');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"MobileCollection":{"mobile":{"user_id":"ALL","card_id":["1","2","3"],"param":{"UserIDs":"ALL","query":{"group_id":1}}}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"MobileCollection":{"mobile":{"user_id":"ALL","card_id":["1","2","3"],"param":{"UserIDs":"ALL","query":{"group_id":1}}}}}');


            $request->setRequestUrl('https://{baseurl}/api/v2/mobile/delete');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/mobile/delete")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/mobile/delete")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/mobile/delete\"\n\n\tpayload := strings.NewReader(\"{\\\"MobileCollection\\\":{\\\"mobile\\\":{\\\"user_id\\\":\\\"ALL\\\",\\\"card_id\\\":[\\\"1\\\",\\\"2\\\",\\\"3\\\"],\\\"param\\\":{\\\"UserIDs\\\":\\\"ALL\\\",\\\"query\\\":{\\\"group_id\\\":1}}}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/mobile/delete");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"MobileCollection": @{ @"mobile": @{
            @"user_id": @"ALL", @"card_id": @[ @"1", @"2", @"3" ], @"param": @{
            @"UserIDs": @"ALL", @"query": @{ @"group_id": @1 } } } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/mobile/delete"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["MobileCollection": ["mobile": [
                  "user_id": "ALL",
                  "card_id": ["1", "2", "3"],
                  "param": [
                    "UserIDs": "ALL",
                    "query": ["group_id": 1]
                  ]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/mobile/delete")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/mobile/delete");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/mobile/delete"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/mobile/delete' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"MobileCollection":{"mobile":{"user_id":"ALL","card_id":["1","2","3"],"param":{"UserIDs":"ALL","query":{"group_id":1}}}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/mobile/delete' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"MobileCollection":{"mobile":{"user_id":"ALL","card_id":["1","2","3"],"param":{"UserIDs":"ALL","query":{"group_id":1}}}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/mobile/delete"


            payload <-
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/mobile/delete" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":\"ALL\",\"card_id\":[\"1\",\"2\",\"3\"],\"param\":{\"UserIDs\":\"ALL\",\"query\":{\"group_id\":1}}}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/mobile/delete")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/mobile:
    post:
      tags:
        - Mobile Access
      summary: Create Mobile Access Card in Airfob Portal
      operationId: createMobile
      description: >-
        This API is used to create Mobile Access Card in Airfob Portal.


        **Note:**

        - When creating mobile access cards, Airfob portal sites are divided
        into regular and dynamic

        - The startDate and endDate fields are used when the sites are dynamic
        sites


        **ToM**

        - ToM uses Extend mode for personal authentication mode when creating a
        card

        - If another device supports ToM in the future, a value mapped to
        cardAuthMode (standard) and cardAuthModeEx (extend) should be added for
        compatibility with devices that do not support Extend

        - In API, if you put in the cardAuthModeEx value, the server internally
        maps the cardAuthMode value


        **Card AuthMode Mapping Table:**


        | **cardAuthModeEx** | **cardAuthMode** |

        | --- | --- |

        | 21 - Card | 2 - Card only |

        | 22 - Card + Face | 3 - Card + Fingerprint |

        | 23 - Card + Fingerprint | 3 - Card + Fingerprint |

        | 24 - Card + PIN | 4 - Card + PIN |

        | 25 - Card + Face or Fingerprint | 5 - Card + Fingerprint or PIN |

        | 26 - Card + Face or PIN | 5 - Card + Fingerprint or PIN |

        | 27 - Card + Fingerprint or PIN | 5 - Card + Fingerprint or PIN |

        | 28 - Card + Face or Fingerprint or PIN | 5 - Card + Fingerprint or PIN
        |

        | 29 - Card + Face + Fingerprint | 6 - Card + Fingerprint + PIN |

        | 30 - Card + Face + PIN | 6 - Card + Fingerprint + PIN |

        | 31 - Card + Fingerprint + Face | 6 - Card + Fingerprint + PIN |

        | 32 - Card + Fingerprint + PIN | 6 - Card + Fingerprint + PIN |

        | 33 - Card + Face or Fingerprint + PIN | 6 - Card + Fingerprint + PIN |

        | 34 - Card + Face + Fingerprint or PIN | 6 - Card + Fingerprint + PIN |

        | 35 - Card + Fingerprint + Face or PIN | 6 - Card + Fingerprint + PIN |
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MobileAccessCardInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileAccessCardResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/mobile \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"MobileCollection":{"mobile":{"user_id":["3"],"name":["test2"],"title":[null],"department":[null],"phone":[null],"email":["test2@suprema.com"],"portraitData":[null],"card_id":["2"],"startDate":[1703563320000],"endDate":[1703649720000],"startTime":[978274800000],"endTime":[1924959540000],"issueCount":[1],"duressMask":[null],"useAlphanumericID":[0],"cardAuthModeEx":[21],"pin":[null],"accessGroupId":[null],"mobileCardType":["4"]}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"MobileCollection":{"mobile":{"user_id":["3"],"name":["test2"],"title":[null],"department":[null],"phone":[null],"email":["test2@suprema.com"],"portraitData":[null],"card_id":["2"],"startDate":[1703563320000],"endDate":[1703649720000],"startTime":[978274800000],"endTime":[1924959540000],"issueCount":[1],"duressMask":[null],"useAlphanumericID":[0],"cardAuthModeEx":[21],"pin":[null],"accessGroupId":[null],"mobileCardType":["4"]}}}'
            |  \
              http POST https://{baseurl}/api/v2/mobile \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"MobileCollection":{"mobile":{"user_id":["3"],"name":["test2"],"title":[null],"department":[null],"phone":[null],"email":["test2@suprema.com"],"portraitData":[null],"card_id":["2"],"startDate":[1703563320000],"endDate":[1703649720000],"startTime":[978274800000],"endTime":[1924959540000],"issueCount":[1],"duressMask":[null],"useAlphanumericID":[0],"cardAuthModeEx":[21],"pin":[null],"accessGroupId":[null],"mobileCardType":["4"]}}}' \
              --output-document \
              - https://{baseurl}/api/v2/mobile
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/mobile",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              MobileCollection: {
                mobile: {
                  user_id: ['3'],
                  name: ['test2'],
                  title: [null],
                  department: [null],
                  phone: [null],
                  email: ['test2@suprema.com'],
                  portraitData: [null],
                  card_id: ['2'],
                  startDate: [1703563320000],
                  endDate: [1703649720000],
                  startTime: [978274800000],
                  endTime: [1924959540000],
                  issueCount: [1],
                  duressMask: [null],
                  useAlphanumericID: [0],
                  cardAuthModeEx: [21],
                  pin: [null],
                  accessGroupId: [null],
                  mobileCardType: ['4']
                }
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/mobile',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                MobileCollection: {
                  mobile: {
                    user_id: ['3'],
                    name: ['test2'],
                    title: [null],
                    department: [null],
                    phone: [null],
                    email: ['test2@suprema.com'],
                    portraitData: [null],
                    card_id: ['2'],
                    startDate: [1703563320000],
                    endDate: [1703649720000],
                    startTime: [978274800000],
                    endTime: [1924959540000],
                    issueCount: [1],
                    duressMask: [null],
                    useAlphanumericID: [0],
                    cardAuthModeEx: [21],
                    pin: [null],
                    accessGroupId: [null],
                    mobileCardType: ['4']
                  }
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/v2/mobile");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "MobileCollection": {
                "mobile": {
                  "user_id": [
                    "3"
                  ],
                  "name": [
                    "test2"
                  ],
                  "title": [
                    null
                  ],
                  "department": [
                    null
                  ],
                  "phone": [
                    null
                  ],
                  "email": [
                    "test2@suprema.com"
                  ],
                  "portraitData": [
                    null
                  ],
                  "card_id": [
                    "2"
                  ],
                  "startDate": [
                    1703563320000
                  ],
                  "endDate": [
                    1703649720000
                  ],
                  "startTime": [
                    978274800000
                  ],
                  "endTime": [
                    1924959540000
                  ],
                  "issueCount": [
                    1
                  ],
                  "duressMask": [
                    null
                  ],
                  "useAlphanumericID": [
                    0
                  ],
                  "cardAuthModeEx": [
                    21
                  ],
                  "pin": [
                    null
                  ],
                  "accessGroupId": [
                    null
                  ],
                  "mobileCardType": [
                    "4"
                  ]
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/mobile',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                MobileCollection: {
                  mobile: {
                    user_id: ['3'],
                    name: ['test2'],
                    title: [null],
                    department: [null],
                    phone: [null],
                    email: ['test2@suprema.com'],
                    portraitData: [null],
                    card_id: ['2'],
                    startDate: [1703563320000],
                    endDate: [1703649720000],
                    startTime: [978274800000],
                    endTime: [1924959540000],
                    issueCount: [1],
                    duressMask: [null],
                    useAlphanumericID: [0],
                    cardAuthModeEx: [21],
                    pin: [null],
                    accessGroupId: [null],
                    mobileCardType: ['4']
                  }
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/mobile';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"MobileCollection":{"mobile":{"user_id":["3"],"name":["test2"],"title":[null],"department":[null],"phone":[null],"email":["test2@suprema.com"],"portraitData":[null],"card_id":["2"],"startDate":[1703563320000],"endDate":[1703649720000],"startTime":[978274800000],"endTime":[1924959540000],"issueCount":[1],"duressMask":[null],"useAlphanumericID":[0],"cardAuthModeEx":[21],"pin":[null],"accessGroupId":[null],"mobileCardType":["4"]}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"MobileCollection":{"mobile":{"user_id":["3"],"name":["test2"],"title":[null],"department":[null],"phone":[null],"email":["test2@suprema.com"],"portraitData":[null],"card_id":["2"],"startDate":[1703563320000],"endDate":[1703649720000],"startTime":[978274800000],"endTime":[1924959540000],"issueCount":[1],"duressMask":[null],"useAlphanumericID":[0],"cardAuthModeEx":[21],"pin":[null],"accessGroupId":[null],"mobileCardType":["4"]}}}'
            };

            fetch('https://{baseurl}/api/v2/mobile', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/mobile",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "MobileCollection": {
                "mobile": {
                  "user_id": [
                    "3"
                  ],
                  "name": [
                    "test2"
                  ],
                  "title": [
                    null
                  ],
                  "department": [
                    null
                  ],
                  "phone": [
                    null
                  ],
                  "email": [
                    "test2@suprema.com"
                  ],
                  "portraitData": [
                    null
                  ],
                  "card_id": [
                    "2"
                  ],
                  "startDate": [
                    1703563320000
                  ],
                  "endDate": [
                    1703649720000
                  ],
                  "startTime": [
                    978274800000
                  ],
                  "endTime": [
                    1924959540000
                  ],
                  "issueCount": [
                    1
                  ],
                  "duressMask": [
                    null
                  ],
                  "useAlphanumericID": [
                    0
                  ],
                  "cardAuthModeEx": [
                    21
                  ],
                  "pin": [
                    null
                  ],
                  "accessGroupId": [
                    null
                  ],
                  "mobileCardType": [
                    "4"
                  ]
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/mobile");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/mobile", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/mobile"


            payload = {"MobileCollection": {"mobile": {
                        "user_id": ["3"],
                        "name": ["test2"],
                        "title": [None],
                        "department": [None],
                        "phone": [None],
                        "email": ["test2@suprema.com"],
                        "portraitData": [None],
                        "card_id": ["2"],
                        "startDate": [1703563320000],
                        "endDate": [1703649720000],
                        "startTime": [978274800000],
                        "endTime": [1924959540000],
                        "issueCount": [1],
                        "duressMask": [None],
                        "useAlphanumericID": [0],
                        "cardAuthModeEx": [21],
                        "pin": [None],
                        "accessGroupId": [None],
                        "mobileCardType": ["4"]
                    }}}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/mobile")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/mobile",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/mobile');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"MobileCollection":{"mobile":{"user_id":["3"],"name":["test2"],"title":[null],"department":[null],"phone":[null],"email":["test2@suprema.com"],"portraitData":[null],"card_id":["2"],"startDate":[1703563320000],"endDate":[1703649720000],"startTime":[978274800000],"endTime":[1924959540000],"issueCount":[1],"duressMask":[null],"useAlphanumericID":[0],"cardAuthModeEx":[21],"pin":[null],"accessGroupId":[null],"mobileCardType":["4"]}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"MobileCollection":{"mobile":{"user_id":["3"],"name":["test2"],"title":[null],"department":[null],"phone":[null],"email":["test2@suprema.com"],"portraitData":[null],"card_id":["2"],"startDate":[1703563320000],"endDate":[1703649720000],"startTime":[978274800000],"endTime":[1924959540000],"issueCount":[1],"duressMask":[null],"useAlphanumericID":[0],"cardAuthModeEx":[21],"pin":[null],"accessGroupId":[null],"mobileCardType":["4"]}}}');


            $request->setRequestUrl('https://{baseurl}/api/v2/mobile');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/mobile")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/mobile")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/mobile\"\n\n\tpayload := strings.NewReader(\"{\\\"MobileCollection\\\":{\\\"mobile\\\":{\\\"user_id\\\":[\\\"3\\\"],\\\"name\\\":[\\\"test2\\\"],\\\"title\\\":[null],\\\"department\\\":[null],\\\"phone\\\":[null],\\\"email\\\":[\\\"test2@suprema.com\\\"],\\\"portraitData\\\":[null],\\\"card_id\\\":[\\\"2\\\"],\\\"startDate\\\":[1703563320000],\\\"endDate\\\":[1703649720000],\\\"startTime\\\":[978274800000],\\\"endTime\\\":[1924959540000],\\\"issueCount\\\":[1],\\\"duressMask\\\":[null],\\\"useAlphanumericID\\\":[0],\\\"cardAuthModeEx\\\":[21],\\\"pin\\\":[null],\\\"accessGroupId\\\":[null],\\\"mobileCardType\\\":[\\\"4\\\"]}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/mobile");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"MobileCollection": @{ @"mobile": @{
            @"user_id": @[ @"3" ], @"name": @[ @"test2" ], @"title": @[  ],
            @"department": @[  ], @"phone": @[  ], @"email": @[
            @"test2@suprema.com" ], @"portraitData": @[  ], @"card_id": @[ @"2"
            ], @"startDate": @[ @1703563320000 ], @"endDate": @[ @1703649720000
            ], @"startTime": @[ @978274800000 ], @"endTime": @[ @1924959540000
            ], @"issueCount": @[ @1 ], @"duressMask": @[  ],
            @"useAlphanumericID": @[ @0 ], @"cardAuthModeEx": @[ @21 ], @"pin":
            @[  ], @"accessGroupId": @[  ], @"mobileCardType": @[ @"4" ] } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/mobile"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["MobileCollection": ["mobile": [
                  "user_id": ["3"],
                  "name": ["test2"],
                  "title": [],
                  "department": [],
                  "phone": [],
                  "email": ["test2@suprema.com"],
                  "portraitData": [],
                  "card_id": ["2"],
                  "startDate": [1703563320000],
                  "endDate": [1703649720000],
                  "startTime": [978274800000],
                  "endTime": [1924959540000],
                  "issueCount": [1],
                  "duressMask": [],
                  "useAlphanumericID": [0],
                  "cardAuthModeEx": [21],
                  "pin": [],
                  "accessGroupId": [],
                  "mobileCardType": ["4"]
                ]]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/mobile")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/v2/mobile");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/mobile"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/v2/mobile'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"MobileCollection":{"mobile":{"user_id":["3"],"name":["test2"],"title":[null],"department":[null],"phone":[null],"email":["test2@suprema.com"],"portraitData":[null],"card_id":["2"],"startDate":[1703563320000],"endDate":[1703649720000],"startTime":[978274800000],"endTime":[1924959540000],"issueCount":[1],"duressMask":[null],"useAlphanumericID":[0],"cardAuthModeEx":[21],"pin":[null],"accessGroupId":[null],"mobileCardType":["4"]}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/v2/mobile'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"MobileCollection":{"mobile":{"user_id":["3"],"name":["test2"],"title":[null],"department":[null],"phone":[null],"email":["test2@suprema.com"],"portraitData":[null],"card_id":["2"],"startDate":[1703563320000],"endDate":[1703649720000],"startTime":[978274800000],"endTime":[1924959540000],"issueCount":[1],"duressMask":[null],"useAlphanumericID":[0],"cardAuthModeEx":[21],"pin":[null],"accessGroupId":[null],"mobileCardType":["4"]}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/mobile"


            payload <-
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/mobile" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"MobileCollection\":{\"mobile\":{\"user_id\":[\"3\"],\"name\":[\"test2\"],\"title\":[null],\"department\":[null],\"phone\":[null],\"email\":[\"test2@suprema.com\"],\"portraitData\":[null],\"card_id\":[\"2\"],\"startDate\":[1703563320000],\"endDate\":[1703649720000],\"startTime\":[978274800000],\"endTime\":[1924959540000],\"issueCount\":[1],\"duressMask\":[null],\"useAlphanumericID\":[0],\"cardAuthModeEx\":[21],\"pin\":[null],\"accessGroupId\":[null],\"mobileCardType\":[\"4\"]}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/mobile")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/cards/mobile/search:
    get:
      tags:
        - Mobile Access
      summary: View Deleted CSN Mobile
      operationId: getCardMobileSearch
      description: This API is used to fetch CSN Mobile information deleted from the list.
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
          description: >-
            Limit the number of responses by n records. Remove this parameter to
            view all.
          example: 50
        - name: offset
          in: query
          schema:
            type: integer
          description: Offset the response shown by n records.
          example: 0
        - name: search_type
          in: query
          schema:
            type: string
          description: Filter the response by card type (DELETED_CSN_MOBILE).
          example: DELETED_CSN_MOBILE
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                example:
                  CardCollection:
                    rows:
                      - id: 11
                        card_id: 1234
                        user_id: 12
                        user_name: test3
                        display_card_id: 1234
                        card_type:
                          id: 4
                          name: CSN Mobile
                          type: 4
                      - id: 12
                        card_id: 5678
                        user_id: 13
                        user_name: test4
                        display_card_id: 5678
                        card_type:
                          id: 4
                          name: CSN Mobile
                          type: 4
                      - id: 15
                        card_id: 2222
                        user_id: 16
                        user_name: test7
                        display_card_id: 2222
                        card_type:
                          id: 4
                          name: CSN Mobile
                          type: 4
                    total: 3
                  Response:
                    code: 0
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/cards/mobile/search',
              qs: {limit: '50', offset: '0', search_type: 'DELETED_CSN_MOBILE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/cards/mobile/search");


            req.query({
              "limit": "50",
              "offset": "0",
              "search_type": "DELETED_CSN_MOBILE"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/cards/mobile/search',
              params: {limit: '50', offset: '0', search_type: 'DELETED_CSN_MOBILE'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/cards/mobile/search"


            querystring =
            {"limit":"50","offset":"0","search_type":"DELETED_CSN_MOBILE"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/cards/mobile/search');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => '50',
              'offset' => '0',
              'search_type' => 'DELETED_CSN_MOBILE'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/cards/mobile/search');

            $request->setRequestMethod('GET');

            $request->setQuery(new http\QueryString([
              'limit' => '50',
              'offset' => '0',
              'search_type' => 'DELETED_CSN_MOBILE'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/cards/mobile/search"


            queryString <- list(
              limit = "50",
              offset = "0"
              search_type = "DELETED_CSN_MOBILE",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/cards/mobile/search?limit=50&offset=0&search_type=DELETED_CSN_MOBILE")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/cards/mobile/enable:
    delete:
      tags:
        - Mobile Access
      summary: Delete CSN Mobile
      operationId: deleteCardMobileEnable
      description: This API is used to delete CSN Mobile information.
      parameters:
        - name: id
          in: query
          schema:
            type: string
          description: >-
            Card UID value, separate using comma (,). Use asterisk (*) to select
            all.
          example: 18,19,20
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http DELETE
            'https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/v2/cards/mobile/enable',
              qs: {id: '18,19,20'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/v2/cards/mobile/enable");


            req.query({
              "id": "18,19,20"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/v2/cards/mobile/enable',
              params: {id: '18,19,20'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("DELETE",
            "https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE",
            "{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/cards/mobile/enable"


            querystring = {"id":"18,19,20"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Delete.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/cards/mobile/enable');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => '18,19,20'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/cards/mobile/enable');

            $request->setRequestMethod('DELETE');

            $request->setQuery(new http\QueryString([
              'id' => '18,19,20'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20'
            -Method DELETE -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20'
            -Method DELETE -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/cards/mobile/enable"


            queryString <- list([ 'id' ] = "18,19,20")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/cards/mobile/enable?id=18%2C19%2C20")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/cards/mobile/count:
    post:
      tags:
        - Mobile Access
      summary: Count Deleted CSN Mobile
      operationId: createCardMobileCount
      description: This API is used to count deleted CSN Mobile information.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - cardUids
              properties:
                cardUids:
                  type: string
                  description: >-
                    List of Mobile Card UID(s) which will be counted, separated
                    by comma (,).
                  example: 11,12,13,16,17
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                example:
                  CardCollection:
                    count: 2
                  Response:
                    code: '0'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/cards/mobile/count \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"cardUids":"11,12,13,16,17"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"cardUids":"11,12,13,16,17"}' |  \
              http POST https://{baseurl}/api/v2/cards/mobile/count \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"cardUids":"11,12,13,16,17"}' \
              --output-document \
              - https://{baseurl}/api/v2/cards/mobile/count
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/cards/mobile/count",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({cardUids: '11,12,13,16,17'}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/cards/mobile/count',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {cardUids: '11,12,13,16,17'},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/cards/mobile/count");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "cardUids": "11,12,13,16,17"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/cards/mobile/count',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {cardUids: '11,12,13,16,17'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/cards/mobile/count';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"cardUids":"11,12,13,16,17"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"cardUids":"11,12,13,16,17"}'
            };

            fetch('https://{baseurl}/api/v2/cards/mobile/count', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/cards/mobile/count",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"cardUids\":\"11,12,13,16,17\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "cardUids": "11,12,13,16,17"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/cards/mobile/count");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"cardUids\":\"11,12,13,16,17\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/cards/mobile/count", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/cards/mobile/count"


            payload = {"cardUids": "11,12,13,16,17"}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/cards/mobile/count")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"cardUids\":\"11,12,13,16,17\"}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/cards/mobile/count",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"cardUids\":\"11,12,13,16,17\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/cards/mobile/count');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"cardUids":"11,12,13,16,17"}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"cardUids":"11,12,13,16,17"}');


            $request->setRequestUrl('https://{baseurl}/api/v2/cards/mobile/count');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"cardUids\":\"11,12,13,16,17\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/cards/mobile/count")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/cards/mobile/count")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"cardUids\":\"11,12,13,16,17\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/cards/mobile/count\"\n\n\tpayload := strings.NewReader(\"{\\\"cardUids\\\":\\\"11,12,13,16,17\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/cards/mobile/count");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"cardUids\":\"11,12,13,16,17\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"cardUids": @"11,12,13,16,17" };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/cards/mobile/count"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["cardUids": "11,12,13,16,17"] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/cards/mobile/count")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/cards/mobile/count");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"cardUids\":\"11,12,13,16,17\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/cards/mobile/count"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"cardUids\":\"11,12,13,16,17\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/cards/mobile/count' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"cardUids":"11,12,13,16,17"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/cards/mobile/count' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"cardUids":"11,12,13,16,17"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/cards/mobile/count"


            payload <- "{\"cardUids\":\"11,12,13,16,17\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/cards/mobile/count" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"cardUids\":\"11,12,13,16,17\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"cardUids\":\"11,12,13,16,17\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/cards/mobile/count")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/event_types:
    get:
      tags:
        - Event Log
      summary: View Event Types
      operationId: listEventTypes
      description: This API is used for listing event types recorded on BioStar X.
      parameters:
        - name: is_break_glass
          in: query
          schema:
            type: boolean
          description: Filter event types which is marked as break glass.
          example: false
        - name: setting_alert
          in: query
          schema:
            type: boolean
          description: >-
            Toggle `true` to list events which will trigger alert. Marked by
            'alertable' parameter on the event. 'enable_alert' is used for
            marking which event will show a pop up notice on BioStar X.
          example: false
        - name: setting_all
          in: query
          schema:
            type: boolean
          description: Toggle true to list all events recorded on database.
          example: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true'
            \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/event_types',
              qs: {is_break_glass: 'false', setting_alert: 'false', setting_all: 'true'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/event_types");

            req.query({
              "is_break_glass": "false",
              "setting_alert": "false",
              "setting_all": "true"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/event_types',
              params: {is_break_glass: 'false', setting_alert: 'false', setting_all: 'true'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/event_types"


            querystring =
            {"is_break_glass":"false","setting_alert":"false","setting_all":"true"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/event_types');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'is_break_glass' => 'false',
              'setting_alert' => 'false',
              'setting_all' => 'true'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/event_types');
            $request->setRequestMethod('GET');
            $request->setQuery(new http\QueryString([
              'is_break_glass' => 'false',
              'setting_alert' => 'false',
              'setting_all' => 'true'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/event_types"


            queryString <- list(
              is_break_glass = "false",
              setting_alert = "false"
              setting_all = "true",
            )


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/event_types?is_break_glass=false&setting_alert=false&setting_all=true")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/events/search:
    post:
      tags:
        - Event Log
      summary: Search Events Example
      operationId: searchEventsSearch
      description: >-
        This example shows how to view event log from device with id: 543308153
        (device timezone set as UTC+8) and log with datetime between 2022-06-01
        00:05 to 2022-06-30 23:58.


        Note that the datetime used on the API criteria is different from what
        the user would like to see. This is because the device was set to use
        UTC+8, so to view the correct log, use datetime which have been
        converted to UTC-0.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Query:
                  type: object
                  properties:
                    limit:
                      type: integer
                      description: Limit the number of responses by n records.
                      example: 5
                    conditions:
                      type: array
                      items:
                        type: object
                        properties:
                          column:
                            type: string
                            description: Column name to be used as filter.
                          operator:
                            type: integer
                            description: Operator number to be used as filter.
                          values:
                            type: array
                            items:
                              type: string
                            description: List of values to be used as filter.
                    orders:
                      type: array
                      items:
                        type: object
                        properties:
                          column:
                            type: string
                            description: Column name to be used as order.
                          descending:
                            type: boolean
                            description: Toggle true to sort descending.
            example:
              Query:
                limit: 5
                conditions:
                  - column: datetime
                    operator: 3
                    values:
                      - '2022-05-31T16:05:00.000Z'
                      - '2022-06-30T15:58:00.000Z'
                  - column: device_id
                    operator: 0
                    values:
                      - '543308153'
                orders:
                  - column: datetime
                    descending: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/events/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Query":{"limit":5,"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Query":{"limit":5,"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
            |  \
              http POST https://{baseurl}/api/events/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Query":{"limit":5,"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}' \
              --output-document \
              - https://{baseurl}/api/events/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/events/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Query: {
                limit: 5,
                conditions: [{column: 'string', operator: 0, values: ['string']}],
                orders: [{column: 'string', descending: true}]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/events/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Query: {
                  limit: 5,
                  conditions: [{column: 'string', operator: 0, values: ['string']}],
                  orders: [{column: 'string', descending: true}]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/events/search");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Query": {
                "limit": 5,
                "conditions": [
                  {
                    "column": "string",
                    "operator": 0,
                    "values": [
                      "string"
                    ]
                  }
                ],
                "orders": [
                  {
                    "column": "string",
                    "descending": true
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/events/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Query: {
                  limit: 5,
                  conditions: [{column: 'string', operator: 0, values: ['string']}],
                  orders: [{column: 'string', descending: true}]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/events/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"limit":5,"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"limit":5,"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
            };

            fetch('https://{baseurl}/api/events/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/events/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Query": {
                "limit": 5,
                "conditions": [
                  {
                    "column": "string",
                    "operator": 0,
                    "values": [
                      "string"
                    ]
                  }
                ],
                "orders": [
                  {
                    "column": "string",
                    "descending": true
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/events/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/events/search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/events/search"


            payload = {"Query": {
                    "limit": 5,
                    "conditions": [
                        {
                            "column": "string",
                            "operator": 0,
                            "values": ["string"]
                        }
                    ],
                    "orders": [
                        {
                            "column": "string",
                            "descending": True
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/events/search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/events/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/events/search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Query":{"limit":5,"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Query":{"limit":5,"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}');


            $request->setRequestUrl('https://{baseurl}/api/events/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/events/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/events/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/events/search\"\n\n\tpayload := strings.NewReader(\"{\\\"Query\\\":{\\\"limit\\\":5,\\\"conditions\\\":[{\\\"column\\\":\\\"string\\\",\\\"operator\\\":0,\\\"values\\\":[\\\"string\\\"]}],\\\"orders\\\":[{\\\"column\\\":\\\"string\\\",\\\"descending\\\":true}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/events/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Query": @{ @"limit": @5,
            @"conditions": @[ @{ @"column": @"string", @"operator": @0,
            @"values": @[ @"string" ] } ], @"orders": @[ @{ @"column":
            @"string", @"descending": @YES } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/events/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Query": [
                "limit": 5,
                "conditions": [
                  [
                    "column": "string",
                    "operator": 0,
                    "values": ["string"]
                  ]
                ],
                "orders": [
                  [
                    "column": "string",
                    "descending": true
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/events/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/events/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/events/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/events/search' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Query":{"limit":5,"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/events/search' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Query":{"limit":5,"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/events/search"


            payload <-
            "{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/events/search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Query\":{\"limit\":5,\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/events/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/events/images/{image_data}:
    get:
      tags:
        - Events
      summary: Fetch Event Image
      operationId: listEventsImages
      description: >-
        When query events through **Search Events** (`/api/events/search`),
        events that contain image logs include the response fields.

        The `image_data` value can be used to retrieve the corresponding image
        file.
      parameters:
        - name: image_data
          in: path
          schema:
            type: string
          required: true
          description: >-
            (String, Required) – The identifier of the image, obtained from the
            event search response.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  image_id:
                    type: object
                    properties:
                      image_data:
                        type: string
                        description: >-
                          The `image_data` value can be used to retrieve the
                          corresponding image file.
                      image_type:
                        type: string
                        description: Image file type
                      photo:
                        type: string
                        description: Indicates if the image is a photo
              example:
                image_id:
                  image_data: 1.7550623415478388e+24
                  image_type: JPG
                  photo: 'false'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/events/images/{image_data} \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/events/images/{image_data} \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/events/images/{image_data}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/events/images/{image_data}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/events/images/{image_data}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/events/images/{image_data}");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/events/images/{image_data}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/events/images/{image_data}';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/events/images/{image_data}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/events/images/{image_data}",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/events/images/{image_data}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/events/images/{image_data}",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/events/images/{image_data}"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/events/images/{image_data}")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/events/images/{image_data}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/events/images/{image_data}');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/events/images/{image_data}');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/events/images/{image_data}")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/events/images/{image_data}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/events/images/{image_data}\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/events/images/{image_data}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/events/images/{image_data}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/events/images/{image_data}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/events/images/{image_data}");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/events/images/{image_data}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/events/images/{image_data}' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/events/images/{image_data}' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/events/images/{image_data}"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/events/images/{image_data}" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/events/images/{image_data}")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/events/search/thermal:
    post:
      tags:
        - Events
      summary: Search Thermal Events
      operationId: searchEventsSearchThermal
      description: |-
        This API is used to view events with thermal data.

        Parameters on this API is the same as Search Events.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                Query:
                  limit: 51
                  conditions:
                    - column: datetime
                      operator: 3
                      values:
                        - '2021-01-27T16:00:00.000Z'
                        - '2022-01-28T15:59:59.000Z'
                  orders:
                    - column: datetime
                      descending: false
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/events/search/thermal \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Query":{"limit":51,"conditions":[{"column":"datetime","operator":3,"values":["2021-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"orders":[{"column":"datetime","descending":false}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Query":{"limit":51,"conditions":[{"column":"datetime","operator":3,"values":["2021-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"orders":[{"column":"datetime","descending":false}]}}'
            |  \
              http POST https://{baseurl}/api/events/search/thermal \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Query":{"limit":51,"conditions":[{"column":"datetime","operator":3,"values":["2021-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"orders":[{"column":"datetime","descending":false}]}}' \
              --output-document \
              - https://{baseurl}/api/events/search/thermal
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/events/search/thermal",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Query: {
                limit: 51,
                conditions: [
                  {
                    column: 'datetime',
                    operator: 3,
                    values: ['2021-01-27T16:00:00.000Z', '2022-01-28T15:59:59.000Z']
                  }
                ],
                orders: [{column: 'datetime', descending: false}]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/events/search/thermal',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Query: {
                  limit: 51,
                  conditions: [
                    {
                      column: 'datetime',
                      operator: 3,
                      values: ['2021-01-27T16:00:00.000Z', '2022-01-28T15:59:59.000Z']
                    }
                  ],
                  orders: [{column: 'datetime', descending: false}]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/events/search/thermal");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "Query": {
                "limit": 51,
                "conditions": [
                  {
                    "column": "datetime",
                    "operator": 3,
                    "values": [
                      "2021-01-27T16:00:00.000Z",
                      "2022-01-28T15:59:59.000Z"
                    ]
                  }
                ],
                "orders": [
                  {
                    "column": "datetime",
                    "descending": false
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/events/search/thermal',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Query: {
                  limit: 51,
                  conditions: [
                    {
                      column: 'datetime',
                      operator: 3,
                      values: ['2021-01-27T16:00:00.000Z', '2022-01-28T15:59:59.000Z']
                    }
                  ],
                  orders: [{column: 'datetime', descending: false}]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/events/search/thermal';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"limit":51,"conditions":[{"column":"datetime","operator":3,"values":["2021-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"orders":[{"column":"datetime","descending":false}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"limit":51,"conditions":[{"column":"datetime","operator":3,"values":["2021-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"orders":[{"column":"datetime","descending":false}]}}'
            };

            fetch('https://{baseurl}/api/events/search/thermal', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/events/search/thermal",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Query": {
                "limit": 51,
                "conditions": [
                  {
                    "column": "datetime",
                    "operator": 3,
                    "values": [
                      "2021-01-27T16:00:00.000Z",
                      "2022-01-28T15:59:59.000Z"
                    ]
                  }
                ],
                "orders": [
                  {
                    "column": "datetime",
                    "descending": false
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/events/search/thermal");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/events/search/thermal", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/events/search/thermal"


            payload = {"Query": {
                    "limit": 51,
                    "conditions": [
                        {
                            "column": "datetime",
                            "operator": 3,
                            "values": ["2021-01-27T16:00:00.000Z", "2022-01-28T15:59:59.000Z"]
                        }
                    ],
                    "orders": [
                        {
                            "column": "datetime",
                            "descending": False
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/events/search/thermal")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/events/search/thermal",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/events/search/thermal');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Query":{"limit":51,"conditions":[{"column":"datetime","operator":3,"values":["2021-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"orders":[{"column":"datetime","descending":false}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Query":{"limit":51,"conditions":[{"column":"datetime","operator":3,"values":["2021-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"orders":[{"column":"datetime","descending":false}]}}');


            $request->setRequestUrl('https://{baseurl}/api/events/search/thermal');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/events/search/thermal")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/events/search/thermal")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/events/search/thermal\"\n\n\tpayload := strings.NewReader(\"{\\\"Query\\\":{\\\"limit\\\":51,\\\"conditions\\\":[{\\\"column\\\":\\\"datetime\\\",\\\"operator\\\":3,\\\"values\\\":[\\\"2021-01-27T16:00:00.000Z\\\",\\\"2022-01-28T15:59:59.000Z\\\"]}],\\\"orders\\\":[{\\\"column\\\":\\\"datetime\\\",\\\"descending\\\":false}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/events/search/thermal");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Query": @{ @"limit": @51,
            @"conditions": @[ @{ @"column": @"datetime", @"operator": @3,
            @"values": @[ @"2021-01-27T16:00:00.000Z",
            @"2022-01-28T15:59:59.000Z" ] } ], @"orders": @[ @{ @"column":
            @"datetime", @"descending": @NO } ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/events/search/thermal"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Query": [
                "limit": 51,
                "conditions": [
                  [
                    "column": "datetime",
                    "operator": 3,
                    "values": ["2021-01-27T16:00:00.000Z", "2022-01-28T15:59:59.000Z"]
                  ]
                ],
                "orders": [
                  [
                    "column": "datetime",
                    "descending": false
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/events/search/thermal")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/events/search/thermal");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/events/search/thermal"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/events/search/thermal' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Query":{"limit":51,"conditions":[{"column":"datetime","operator":3,"values":["2021-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"orders":[{"column":"datetime","descending":false}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/events/search/thermal' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Query":{"limit":51,"conditions":[{"column":"datetime","operator":3,"values":["2021-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"orders":[{"column":"datetime","descending":false}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/events/search/thermal"


            payload <-
            "{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/events/search/thermal" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Query\":{\"limit\":51,\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2021-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"orders\":[{\"column\":\"datetime\",\"descending\":false}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/events/search/thermal")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/events/export:
    post:
      tags:
        - Events
      summary: Export as CSV
      operationId: exportEventsExport
      description: >-
        This API is used to export events to a .csv file. Exported .csv will be
        saved on BioStar X Server installation path. To get it from the server,
        use Download Events Exported CSV API.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Query:
                  $ref: '#/components/schemas/ExportCSV'
              example:
                Query:
                  conditions:
                    - column: datetime
                      operator: 3
                      values:
                        - '2022-01-27T16:00:00.000Z'
                        - '2022-01-28T15:59:59.000Z'
                  offset: 0
                  columns:
                    - datetime
                    - door_id.name
                    - device_id.id
                    - device_id.name
                    - user_group_id
                    - user_id
                    - temperature
                    - event_type_id
                    - tna_key
                  headers:
                    - Date
                    - Door
                    - Device ID
                    - Device
                    - User Group
                    - User
                    - Temperature
                    - Event
                    - TNA Key
      parameters:
        - name: time_offset
          in: query
          schema:
            type: integer
          description: Shift time on the exported file by n minutes
          example: 480
        - name: use_centigrade
          in: query
          schema:
            type: boolean
          description: Toggle for the use of centigrade
          example: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Query":{"conditions":[{"column":"datetime","operator":3,"values":["2022-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"offset":0,"columns":["datetime","door_id.name","device_id.id","device_id.name","user_group_id","user_id","temperature","event_type_id","tna_key"],"headers":["Date","Door","Device ID","Device","User Group","User","Temperature","Event","TNA Key"]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Query":{"conditions":[{"column":"datetime","operator":3,"values":["2022-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"offset":0,"columns":["datetime","door_id.name","device_id.id","device_id.name","user_group_id","user_id","temperature","event_type_id","tna_key"],"headers":["Date","Door","Device
            ID","Device","User Group","User","Temperature","Event","TNA Key"]}}'
            |  \
              http POST 'https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Query":{"conditions":[{"column":"datetime","operator":3,"values":["2022-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"offset":0,"columns":["datetime","door_id.name","device_id.id","device_id.name","user_group_id","user_id","temperature","event_type_id","tna_key"],"headers":["Date","Door","Device ID","Device","User Group","User","Temperature","Event","TNA Key"]}}' \
              --output-document \
              - 'https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/events/export?time_offset=480&use_centigrade=true",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Query: {
                conditions: [
                  {
                    column: 'datetime',
                    operator: 3,
                    values: ['2022-01-27T16:00:00.000Z', '2022-01-28T15:59:59.000Z']
                  }
                ],
                offset: 0,
                columns: [
                  'datetime',
                  'door_id.name',
                  'device_id.id',
                  'device_id.name',
                  'user_group_id',
                  'user_id',
                  'temperature',
                  'event_type_id',
                  'tna_key'
                ],
                headers: [
                  'Date',
                  'Door',
                  'Device ID',
                  'Device',
                  'User Group',
                  'User',
                  'Temperature',
                  'Event',
                  'TNA Key'
                ]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/events/export',
              qs: {time_offset: '480', use_centigrade: 'true'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Query: {
                  conditions: [
                    {
                      column: 'datetime',
                      operator: 3,
                      values: ['2022-01-27T16:00:00.000Z', '2022-01-28T15:59:59.000Z']
                    }
                  ],
                  offset: 0,
                  columns: [
                    'datetime',
                    'door_id.name',
                    'device_id.id',
                    'device_id.name',
                    'user_group_id',
                    'user_id',
                    'temperature',
                    'event_type_id',
                    'tna_key'
                  ],
                  headers: [
                    'Date',
                    'Door',
                    'Device ID',
                    'Device',
                    'User Group',
                    'User',
                    'Temperature',
                    'Event',
                    'TNA Key'
                  ]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/events/export");

            req.query({
              "time_offset": "480",
              "use_centigrade": "true"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Query": {
                "conditions": [
                  {
                    "column": "datetime",
                    "operator": 3,
                    "values": [
                      "2022-01-27T16:00:00.000Z",
                      "2022-01-28T15:59:59.000Z"
                    ]
                  }
                ],
                "offset": 0,
                "columns": [
                  "datetime",
                  "door_id.name",
                  "device_id.id",
                  "device_id.name",
                  "user_group_id",
                  "user_id",
                  "temperature",
                  "event_type_id",
                  "tna_key"
                ],
                "headers": [
                  "Date",
                  "Door",
                  "Device ID",
                  "Device",
                  "User Group",
                  "User",
                  "Temperature",
                  "Event",
                  "TNA Key"
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/events/export',
              params: {time_offset: '480', use_centigrade: 'true'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Query: {
                  conditions: [
                    {
                      column: 'datetime',
                      operator: 3,
                      values: ['2022-01-27T16:00:00.000Z', '2022-01-28T15:59:59.000Z']
                    }
                  ],
                  offset: 0,
                  columns: [
                    'datetime',
                    'door_id.name',
                    'device_id.id',
                    'device_id.name',
                    'user_group_id',
                    'user_id',
                    'temperature',
                    'event_type_id',
                    'tna_key'
                  ],
                  headers: [
                    'Date',
                    'Door',
                    'Device ID',
                    'Device',
                    'User Group',
                    'User',
                    'Temperature',
                    'Event',
                    'TNA Key'
                  ]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true';


            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"conditions":[{"column":"datetime","operator":3,"values":["2022-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"offset":0,"columns":["datetime","door_id.name","device_id.id","device_id.name","user_group_id","user_id","temperature","event_type_id","tna_key"],"headers":["Date","Door","Device ID","Device","User Group","User","Temperature","Event","TNA Key"]}}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"conditions":[{"column":"datetime","operator":3,"values":["2022-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"offset":0,"columns":["datetime","door_id.name","device_id.id","device_id.name","user_group_id","user_id","temperature","event_type_id","tna_key"],"headers":["Date","Door","Device ID","Device","User Group","User","Temperature","Event","TNA Key"]}}'
            };


            fetch('https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device ID\",\"Device\",\"User Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "Query": {
                "conditions": [
                  {
                    "column": "datetime",
                    "operator": 3,
                    "values": [
                      "2022-01-27T16:00:00.000Z",
                      "2022-01-28T15:59:59.000Z"
                    ]
                  }
                ],
                "offset": 0,
                "columns": [
                  "datetime",
                  "door_id.name",
                  "device_id.id",
                  "device_id.name",
                  "user_group_id",
                  "user_id",
                  "temperature",
                  "event_type_id",
                  "tna_key"
                ],
                "headers": [
                  "Date",
                  "Door",
                  "Device ID",
                  "Device",
                  "User Group",
                  "User",
                  "Temperature",
                  "Event",
                  "TNA Key"
                ]
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device
            ID\",\"Device\",\"User
            Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/events/export?time_offset=480&use_centigrade=true",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/events/export"


            querystring = {"time_offset":"480","use_centigrade":"true"}


            payload = {"Query": {
                    "conditions": [
                        {
                            "column": "datetime",
                            "operator": 3,
                            "values": ["2022-01-27T16:00:00.000Z", "2022-01-28T15:59:59.000Z"]
                        }
                    ],
                    "offset": 0,
                    "columns": ["datetime", "door_id.name", "device_id.id", "device_id.name", "user_group_id", "user_id", "temperature", "event_type_id", "tna_key"],
                    "headers": ["Date", "Door", "Device ID", "Device", "User Group", "User", "Temperature", "Event", "TNA Key"]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device
            ID\",\"Device\",\"User
            Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device ID\",\"Device\",\"User Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/events/export');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'time_offset' => '480',
              'use_centigrade' => 'true'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Query":{"conditions":[{"column":"datetime","operator":3,"values":["2022-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"offset":0,"columns":["datetime","door_id.name","device_id.id","device_id.name","user_group_id","user_id","temperature","event_type_id","tna_key"],"headers":["Date","Door","Device
            ID","Device","User Group","User","Temperature","Event","TNA
            Key"]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Query":{"conditions":[{"column":"datetime","operator":3,"values":["2022-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"offset":0,"columns":["datetime","door_id.name","device_id.id","device_id.name","user_group_id","user_id","temperature","event_type_id","tna_key"],"headers":["Date","Door","Device
            ID","Device","User Group","User","Temperature","Event","TNA
            Key"]}}');


            $request->setRequestUrl('https://{baseurl}/api/events/export');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'time_offset' => '480',
              'use_centigrade' => 'true'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device
            ID\",\"Device\",\"User
            Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device ID\",\"Device\",\"User Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true\"\n\n\tpayload := strings.NewReader(\"{\\\"Query\\\":{\\\"conditions\\\":[{\\\"column\\\":\\\"datetime\\\",\\\"operator\\\":3,\\\"values\\\":[\\\"2022-01-27T16:00:00.000Z\\\",\\\"2022-01-28T15:59:59.000Z\\\"]}],\\\"offset\\\":0,\\\"columns\\\":[\\\"datetime\\\",\\\"door_id.name\\\",\\\"device_id.id\\\",\\\"device_id.name\\\",\\\"user_group_id\\\",\\\"user_id\\\",\\\"temperature\\\",\\\"event_type_id\\\",\\\"tna_key\\\"],\\\"headers\\\":[\\\"Date\\\",\\\"Door\\\",\\\"Device ID\\\",\\\"Device\\\",\\\"User Group\\\",\\\"User\\\",\\\"Temperature\\\",\\\"Event\\\",\\\"TNA Key\\\"]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device
            ID\",\"Device\",\"User
            Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Query": @{ @"conditions": @[ @{
            @"column": @"datetime", @"operator": @3, @"values": @[
            @"2022-01-27T16:00:00.000Z", @"2022-01-28T15:59:59.000Z" ] } ],
            @"offset": @0, @"columns": @[ @"datetime", @"door_id.name",
            @"device_id.id", @"device_id.name", @"user_group_id", @"user_id",
            @"temperature", @"event_type_id", @"tna_key" ], @"headers": @[
            @"Date", @"Door", @"Device ID", @"Device", @"User Group", @"User",
            @"Temperature", @"Event", @"TNA Key" ] } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Query": [
                "conditions": [
                  [
                    "column": "datetime",
                    "operator": 3,
                    "values": ["2022-01-27T16:00:00.000Z", "2022-01-28T15:59:59.000Z"]
                  ]
                ],
                "offset": 0,
                "columns": ["datetime", "door_id.name", "device_id.id", "device_id.name", "user_group_id", "user_id", "temperature", "event_type_id", "tna_key"],
                "headers": ["Date", "Door", "Device ID", "Device", "User Group", "User", "Temperature", "Event", "TNA Key"]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true")!
            as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device
            ID\",\"Device\",\"User
            Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device ID\",\"Device\",\"User Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Query":{"conditions":[{"column":"datetime","operator":3,"values":["2022-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"offset":0,"columns":["datetime","door_id.name","device_id.id","device_id.name","user_group_id","user_id","temperature","event_type_id","tna_key"],"headers":["Date","Door","Device
            ID","Device","User Group","User","Temperature","Event","TNA Key"]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Query":{"conditions":[{"column":"datetime","operator":3,"values":["2022-01-27T16:00:00.000Z","2022-01-28T15:59:59.000Z"]}],"offset":0,"columns":["datetime","door_id.name","device_id.id","device_id.name","user_group_id","user_id","temperature","event_type_id","tna_key"],"headers":["Date","Door","Device
            ID","Device","User Group","User","Temperature","Event","TNA Key"]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/events/export"


            queryString <- list(
              time_offset = "480"
              use_centigrade = "true",
            )


            payload <-
            "{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device
            ID\",\"Device\",\"User
            Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device
            ID\",\"Device\",\"User
            Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Query\":{\"conditions\":[{\"column\":\"datetime\",\"operator\":3,\"values\":[\"2022-01-27T16:00:00.000Z\",\"2022-01-28T15:59:59.000Z\"]}],\"offset\":0,\"columns\":[\"datetime\",\"door_id.name\",\"device_id.id\",\"device_id.name\",\"user_group_id\",\"user_id\",\"temperature\",\"event_type_id\",\"tna_key\"],\"headers\":[\"Date\",\"Door\",\"Device
            ID\",\"Device\",\"User
            Group\",\"User\",\"Temperature\",\"Event\",\"TNA Key\"]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/events/export?time_offset=480&use_centigrade=true")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/alerts/search:
    post:
      tags:
        - Events
      summary: 'List All Alerts: Filter & Sort by Date'
      operationId: searchAlertsSearch
      description: >-
        This example shows how to use the parameters on this API to filter
        responses according to the datetime of the alert events.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Query:
                  type: object
                  properties:
                    conditions:
                      $ref: '#/components/schemas/QueryConditions'
                    orders:
                      type: array
                      items:
                        type: object
                        properties:
                          column:
                            type: string
                            description: Column name to be used as order.
                          descending:
                            type: boolean
                            description: Toggle true to sort descending.
            example:
              Query:
                conditions:
                  - column: event_id.datetime
                    operator: 3
                    values:
                      - '2023-02-02T00:00:00.00Z'
                      - '2023-02-03T00:00:00.00Z'
                orders:
                  - column: event_id.datetime
                    descending: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/alerts/search \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
            |  \
              http POST https://{baseurl}/api/alerts/search \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}' \
              --output-document \
              - https://{baseurl}/api/alerts/search
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/alerts/search",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Query: {
                conditions: [{column: 'string', operator: 0, values: ['string']}],
                orders: [{column: 'string', descending: true}]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/alerts/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Query: {
                  conditions: [{column: 'string', operator: 0, values: ['string']}],
                  orders: [{column: 'string', descending: true}]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/alerts/search");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Query": {
                "conditions": [
                  {
                    "column": "string",
                    "operator": 0,
                    "values": [
                      "string"
                    ]
                  }
                ],
                "orders": [
                  {
                    "column": "string",
                    "descending": true
                  }
                ]
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/alerts/search',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Query: {
                  conditions: [{column: 'string', operator: 0, values: ['string']}],
                  orders: [{column: 'string', descending: true}]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/alerts/search';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
            };

            fetch('https://{baseurl}/api/alerts/search', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/alerts/search",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Query": {
                "conditions": [
                  {
                    "column": "string",
                    "operator": 0,
                    "values": [
                      "string"
                    ]
                  }
                ],
                "orders": [
                  {
                    "column": "string",
                    "descending": true
                  }
                ]
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/alerts/search");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/alerts/search", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/alerts/search"


            payload = {"Query": {
                    "conditions": [
                        {
                            "column": "string",
                            "operator": 0,
                            "values": ["string"]
                        }
                    ],
                    "orders": [
                        {
                            "column": "string",
                            "descending": True
                        }
                    ]
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/alerts/search")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/alerts/search",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/alerts/search');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}');


            $request->setRequestUrl('https://{baseurl}/api/alerts/search');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/alerts/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/alerts/search")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/alerts/search\"\n\n\tpayload := strings.NewReader(\"{\\\"Query\\\":{\\\"conditions\\\":[{\\\"column\\\":\\\"string\\\",\\\"operator\\\":0,\\\"values\\\":[\\\"string\\\"]}],\\\"orders\\\":[{\\\"column\\\":\\\"string\\\",\\\"descending\\\":true}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/alerts/search");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Query": @{ @"conditions": @[ @{
            @"column": @"string", @"operator": @0, @"values": @[ @"string" ] }
            ], @"orders": @[ @{ @"column": @"string", @"descending": @YES } ] }
            };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/alerts/search"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Query": [
                "conditions": [
                  [
                    "column": "string",
                    "operator": 0,
                    "values": ["string"]
                  ]
                ],
                "orders": [
                  [
                    "column": "string",
                    "descending": true
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/alerts/search")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/alerts/search");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/alerts/search"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/alerts/search' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/alerts/search' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"orders":[{"column":"string","descending":true}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/alerts/search"


            payload <-
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/alerts/search" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"orders\":[{\"column\":\"string\",\"descending\":true}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/alerts/search")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/alerts/{alert_id}:
    put:
      tags:
        - Events
      summary: Update Alert History
      operationId: updateAlerts
      description: >-
        This API is used to log `alertable: true` events (`GET
        /api/event_types`) to Alert Collection (`POST /api/alerts/search`)
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Alert:
                  type: object
                  required:
                    - event_id
                    - status
                    - ack_user_id
                    - ack_message
                  properties:
                    event_id:
                      type: object
                      properties:
                        datetime:
                          type: string
                          format: date-time
                          description: Datetime as shown on events
                          example: '2022-02-02T00:00:00.00Z'
                    status:
                      type: integer
                      description: 'Default: 1'
                      default: 1
                      example: 1
                    ack_user_id:
                      type: object
                      properties:
                        user_id:
                          type: string
                          description: >-
                            User ID/Name which will be recorded on the Alert
                            Log.
                          default: '1'
                          example: '1'
                    ack_message:
                      type: string
                      description: Custom message which will be recorded on the Alert Log
                      example: test
      parameters:
        - name: alert_id
          in: path
          schema:
            type: integer
          required: true
          description: Unique ID recorded on hint parameter (POST /api/events/search)
          example: 1.643790735054372e+29
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url 'https://{baseurl}/api/alerts/1.643790735054372e+29' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Alert":{"event_id":{"datetime":"2022-02-02T00:00:00.00Z"},"status":1,"ack_user_id":{"user_id":"1"},"ack_message":"test"}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Alert":{"event_id":{"datetime":"2022-02-02T00:00:00.00Z"},"status":1,"ack_user_id":{"user_id":"1"},"ack_message":"test"}}'
            |  \
              http PUT 'https://{baseurl}/api/alerts/1.643790735054372e+29' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Alert":{"event_id":{"datetime":"2022-02-02T00:00:00.00Z"},"status":1,"ack_user_id":{"user_id":"1"},"ack_message":"test"}}' \
              --output-document \
              - 'https://{baseurl}/api/alerts/1.643790735054372e+29'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/alerts/1.643790735054372e+29",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Alert: {
                event_id: {datetime: '2022-02-02T00:00:00.00Z'},
                status: 1,
                ack_user_id: {user_id: '1'},
                ack_message: 'test'
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/alerts/1.643790735054372e+29',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Alert: {
                  event_id: {datetime: '2022-02-02T00:00:00.00Z'},
                  status: 1,
                  ack_user_id: {user_id: '1'},
                  ack_message: 'test'
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/alerts/1.643790735054372e+29");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "Alert": {
                "event_id": {
                  "datetime": "2022-02-02T00:00:00.00Z"
                },
                "status": 1,
                "ack_user_id": {
                  "user_id": "1"
                },
                "ack_message": "test"
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/alerts/1.643790735054372e+29',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Alert: {
                  event_id: {datetime: '2022-02-02T00:00:00.00Z'},
                  status: 1,
                  ack_user_id: {user_id: '1'},
                  ack_message: 'test'
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/alerts/1.643790735054372e+29';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Alert":{"event_id":{"datetime":"2022-02-02T00:00:00.00Z"},"status":1,"ack_user_id":{"user_id":"1"},"ack_message":"test"}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Alert":{"event_id":{"datetime":"2022-02-02T00:00:00.00Z"},"status":1,"ack_user_id":{"user_id":"1"},"ack_message":"test"}}'
            };

            fetch('https://{baseurl}/api/alerts/1.643790735054372e+29', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/alerts/1.643790735054372e+29",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "Alert": {
                "event_id": {
                  "datetime": "2022-02-02T00:00:00.00Z"
                },
                "status": 1,
                "ack_user_id": {
                  "user_id": "1"
                },
                "ack_message": "test"
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("PUT",
            "https://{baseurl}/api/alerts/1.643790735054372e+29");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/alerts/1.643790735054372e+29",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/alerts/1.643790735054372e+29"


            payload = {"Alert": {
                    "event_id": {"datetime": "2022-02-02T00:00:00.00Z"},
                    "status": 1,
                    "ack_user_id": {"user_id": "1"},
                    "ack_message": "test"
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/alerts/1.643790735054372e+29")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/alerts/1.643790735054372e+29",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/alerts/1.643790735054372e+29');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Alert":{"event_id":{"datetime":"2022-02-02T00:00:00.00Z"},"status":1,"ack_user_id":{"user_id":"1"},"ack_message":"test"}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Alert":{"event_id":{"datetime":"2022-02-02T00:00:00.00Z"},"status":1,"ack_user_id":{"user_id":"1"},"ack_message":"test"}}');


            $request->setRequestUrl('https://{baseurl}/api/alerts/1.643790735054372e+29');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/alerts/1.643790735054372e+29")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/alerts/1.643790735054372e+29")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/alerts/1.643790735054372e+29\"\n\n\tpayload := strings.NewReader(\"{\\\"Alert\\\":{\\\"event_id\\\":{\\\"datetime\\\":\\\"2022-02-02T00:00:00.00Z\\\"},\\\"status\\\":1,\\\"ack_user_id\\\":{\\\"user_id\\\":\\\"1\\\"},\\\"ack_message\\\":\\\"test\\\"}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/alerts/1.643790735054372e+29");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Alert": @{ @"event_id": @{
            @"datetime": @"2022-02-02T00:00:00.00Z" }, @"status": @1,
            @"ack_user_id": @{ @"user_id": @"1" }, @"ack_message": @"test" } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/alerts/1.643790735054372e+29"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Alert": [
                "event_id": ["datetime": "2022-02-02T00:00:00.00Z"],
                "status": 1,
                "ack_user_id": ["user_id": "1"],
                "ack_message": "test"
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/alerts/1.643790735054372e+29")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/alerts/1.643790735054372e+29");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/alerts/1.643790735054372e+29"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/alerts/1.643790735054372e+29' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"Alert":{"event_id":{"datetime":"2022-02-02T00:00:00.00Z"},"status":1,"ack_user_id":{"user_id":"1"},"ack_message":"test"}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/alerts/1.643790735054372e+29' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"Alert":{"event_id":{"datetime":"2022-02-02T00:00:00.00Z"},"status":1,"ack_user_id":{"user_id":"1"},"ack_message":"test"}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/alerts/1.643790735054372e+29"


            payload <-
            "{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/alerts/1.643790735054372e+29" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Alert\":{\"event_id\":{\"datetime\":\"2022-02-02T00:00:00.00Z\"},\"status\":1,\"ack_user_id\":{\"user_id\":\"1\"},\"ack_message\":\"test\"}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/alerts/1.643790735054372e+29")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/zones/{id}/tracking:
    post:
      tags:
        - Events
      summary: View a Muster Zone Status
      operationId: createZonesTracking
      description: This API is used to view a muster zone status.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Query:
                  type: object
                  required:
                    - limit
                  properties:
                    limit:
                      type: integer
                      description: >-
                        Specify the number of records which shown on the
                        response
                      example: 51
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          example: 32787
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/zones/32787/tracking \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Query":{"limit":51}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"Query":{"limit":51}}' |  \
              http POST https://{baseurl}/api/zones/32787/tracking \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Query":{"limit":51}}' \
              --output-document \
              - https://{baseurl}/api/zones/32787/tracking
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/zones/32787/tracking",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({Query: {limit: 51}}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/zones/32787/tracking',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {Query: {limit: 51}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/zones/32787/tracking");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "Query": {
                "limit": 51
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/zones/32787/tracking',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {Query: {limit: 51}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/zones/32787/tracking';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"limit":51}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"limit":51}}'
            };

            fetch('https://{baseurl}/api/zones/32787/tracking', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/zones/32787/tracking",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Query\":{\"limit\":51}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Query": {
                "limit": 51
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/zones/32787/tracking");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"Query\":{\"limit\":51}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/zones/32787/tracking", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/zones/32787/tracking"


            payload = {"Query": {"limit": 51}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/zones/32787/tracking")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Post.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"Query\":{\"limit\":51}}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/zones/32787/tracking",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Query\":{\"limit\":51}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/zones/32787/tracking');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"Query":{"limit":51}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Query":{"limit":51}}');


            $request->setRequestUrl('https://{baseurl}/api/zones/32787/tracking');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Query\":{\"limit\":51}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/zones/32787/tracking")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/zones/32787/tracking")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Query\":{\"limit\":51}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/zones/32787/tracking\"\n\n\tpayload := strings.NewReader(\"{\\\"Query\\\":{\\\"limit\\\":51}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/zones/32787/tracking");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Query\":{\"limit\":51}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Query": @{ @"limit": @51 } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/zones/32787/tracking"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Query": ["limit": 51]] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/zones/32787/tracking")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/zones/32787/tracking");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Query\":{\"limit\":51}}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/zones/32787/tracking"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Query\":{\"limit\":51}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/zones/32787/tracking' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Query":{"limit":51}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/zones/32787/tracking' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Query":{"limit":51}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/zones/32787/tracking"


            payload <- "{\"Query\":{\"limit\":51}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/zones/32787/tracking"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string "{\"Query\":{\"limit\":51}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Query\":{\"limit\":51}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/zones/32787/tracking")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/audit/userlist:
    post:
      tags:
        - Audit
      summary: Audit Search User
      operationId: createAuditUserlist
      description: >-
        This API is used to filter user by the specified input.


        Do note the API will only show records of user which have Audit Trail
        logs only.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Userlist:
                  $ref: '#/components/schemas/AuditSearchRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/audit/userlist \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Userlist":{"search":"ag","limit":201,"offset":0}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"Userlist":{"search":"ag","limit":201,"offset":0}}' |  \
              http POST https://{baseurl}/api/audit/userlist \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Userlist":{"search":"ag","limit":201,"offset":0}}' \
              --output-document \
              - https://{baseurl}/api/audit/userlist
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/audit/userlist",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({Userlist: {search: 'ag', limit: 201,
            offset: 0}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/userlist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {Userlist: {search: 'ag', limit: 201, offset: 0}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/audit/userlist");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Userlist": {
                "search": "ag",
                "limit": 201,
                "offset": 0
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/userlist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {Userlist: {search: 'ag', limit: 201, offset: 0}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/audit/userlist';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Userlist":{"search":"ag","limit":201,"offset":0}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Userlist":{"search":"ag","limit":201,"offset":0}}'
            };

            fetch('https://{baseurl}/api/audit/userlist', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/audit/userlist",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Userlist": {
                "search": "ag",
                "limit": 201,
                "offset": 0
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/audit/userlist");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/audit/userlist", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/audit/userlist"


            payload = {"Userlist": {
                    "search": "ag",
                    "limit": 201,
                    "offset": 0
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/audit/userlist")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/audit/userlist",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/audit/userlist');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Userlist":{"search":"ag","limit":201,"offset":0}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Userlist":{"search":"ag","limit":201,"offset":0}}');


            $request->setRequestUrl('https://{baseurl}/api/audit/userlist');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/audit/userlist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/audit/userlist")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/audit/userlist\"\n\n\tpayload := strings.NewReader(\"{\\\"Userlist\\\":{\\\"search\\\":\\\"ag\\\",\\\"limit\\\":201,\\\"offset\\\":0}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/audit/userlist");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Userlist": @{ @"search": @"ag",
            @"limit": @201, @"offset": @0 } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/audit/userlist"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Userlist": [
                "search": "ag",
                "limit": 201,
                "offset": 0
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/audit/userlist")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/audit/userlist");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/audit/userlist"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/audit/userlist' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Userlist":{"search":"ag","limit":201,"offset":0}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/audit/userlist' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Userlist":{"search":"ag","limit":201,"offset":0}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/audit/userlist"


            payload <-
            "{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/audit/userlist" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Userlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/audit/userlist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/audit/permlist:
    post:
      tags:
        - Audit
      summary: Audit Search Operator Level
      operationId: createAuditPermlist
      description: >-
        This API is used to filter Operator Level by the specified input.


        Do note the API will only show records of Operator Level which have
        Audit Trail logs only.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Permlist:
                  $ref: '#/components/schemas/AuditSearchRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/audit/permlist \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Permlist":{"search":"ag","limit":201,"offset":0}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"Permlist":{"search":"ag","limit":201,"offset":0}}' |  \
              http POST https://{baseurl}/api/audit/permlist \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Permlist":{"search":"ag","limit":201,"offset":0}}' \
              --output-document \
              - https://{baseurl}/api/audit/permlist
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/audit/permlist",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({Permlist: {search: 'ag', limit: 201,
            offset: 0}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/permlist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {Permlist: {search: 'ag', limit: 201, offset: 0}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/audit/permlist");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Permlist": {
                "search": "ag",
                "limit": 201,
                "offset": 0
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/permlist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {Permlist: {search: 'ag', limit: 201, offset: 0}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/audit/permlist';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Permlist":{"search":"ag","limit":201,"offset":0}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Permlist":{"search":"ag","limit":201,"offset":0}}'
            };

            fetch('https://{baseurl}/api/audit/permlist', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/audit/permlist",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Permlist": {
                "search": "ag",
                "limit": 201,
                "offset": 0
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/audit/permlist");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/audit/permlist", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/audit/permlist"


            payload = {"Permlist": {
                    "search": "ag",
                    "limit": 201,
                    "offset": 0
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/audit/permlist")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/audit/permlist",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/audit/permlist');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Permlist":{"search":"ag","limit":201,"offset":0}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Permlist":{"search":"ag","limit":201,"offset":0}}');


            $request->setRequestUrl('https://{baseurl}/api/audit/permlist');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/audit/permlist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/audit/permlist")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/audit/permlist\"\n\n\tpayload := strings.NewReader(\"{\\\"Permlist\\\":{\\\"search\\\":\\\"ag\\\",\\\"limit\\\":201,\\\"offset\\\":0}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/audit/permlist");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Permlist": @{ @"search": @"ag",
            @"limit": @201, @"offset": @0 } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/audit/permlist"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Permlist": [
                "search": "ag",
                "limit": 201,
                "offset": 0
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/audit/permlist")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/audit/permlist");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/audit/permlist"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/audit/permlist' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Permlist":{"search":"ag","limit":201,"offset":0}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/audit/permlist' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Permlist":{"search":"ag","limit":201,"offset":0}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/audit/permlist"


            payload <-
            "{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/audit/permlist" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Permlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/audit/permlist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/audit/iplist:
    post:
      tags:
        - Audit
      summary: Audit Search IP List
      operationId: createAuditIplist
      description: |-
        This API is used to filter IP records by the specified input.

        Do note the API will only show records which have Audit Trail logs only.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Iplist:
                  $ref: '#/components/schemas/AuditSearchRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/audit/iplist \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Iplist":{"search":"ag","limit":201,"offset":0}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"Iplist":{"search":"ag","limit":201,"offset":0}}' |  \
              http POST https://{baseurl}/api/audit/iplist \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Iplist":{"search":"ag","limit":201,"offset":0}}' \
              --output-document \
              - https://{baseurl}/api/audit/iplist
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/audit/iplist",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({Iplist: {search: 'ag', limit: 201, offset:
            0}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/iplist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {Iplist: {search: 'ag', limit: 201, offset: 0}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/audit/iplist");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Iplist": {
                "search": "ag",
                "limit": 201,
                "offset": 0
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/iplist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {Iplist: {search: 'ag', limit: 201, offset: 0}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/audit/iplist';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Iplist":{"search":"ag","limit":201,"offset":0}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Iplist":{"search":"ag","limit":201,"offset":0}}'
            };

            fetch('https://{baseurl}/api/audit/iplist', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/audit/iplist",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Iplist": {
                "search": "ag",
                "limit": 201,
                "offset": 0
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/audit/iplist");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/audit/iplist", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/audit/iplist"


            payload = {"Iplist": {
                    "search": "ag",
                    "limit": 201,
                    "offset": 0
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/audit/iplist")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/audit/iplist",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/audit/iplist');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Iplist":{"search":"ag","limit":201,"offset":0}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $body = new http\Message\Body;
            $body->append('{"Iplist":{"search":"ag","limit":201,"offset":0}}');

            $request->setRequestUrl('https://{baseurl}/api/audit/iplist');
            $request->setRequestMethod('POST');
            $request->setBody($body);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/audit/iplist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/audit/iplist")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/audit/iplist\"\n\n\tpayload := strings.NewReader(\"{\\\"Iplist\\\":{\\\"search\\\":\\\"ag\\\",\\\"limit\\\":201,\\\"offset\\\":0}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/audit/iplist");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Iplist": @{ @"search": @"ag",
            @"limit": @201, @"offset": @0 } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/audit/iplist"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Iplist": [
                "search": "ag",
                "limit": 201,
                "offset": 0
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/audit/iplist")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/audit/iplist");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/audit/iplist"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/audit/iplist' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Iplist":{"search":"ag","limit":201,"offset":0}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/audit/iplist' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"Iplist":{"search":"ag","limit":201,"offset":0}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/audit/iplist"


            payload <-
            "{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/audit/iplist" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Iplist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/audit/iplist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/audit/targetlist:
    post:
      tags:
        - Audit
      summary: Audit Search Target List
      operationId: createAuditTargetlist
      description: |-
        This API is used to filter Target records by the specified input.

        Do note the API will only show records which have Audit Trail logs only.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Targetlist:
                  $ref: '#/components/schemas/AuditSearchRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/audit/targetlist \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Targetlist":{"search":"ag","limit":201,"offset":0}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"Targetlist":{"search":"ag","limit":201,"offset":0}}' |  \
              http POST https://{baseurl}/api/audit/targetlist \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Targetlist":{"search":"ag","limit":201,"offset":0}}' \
              --output-document \
              - https://{baseurl}/api/audit/targetlist
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/audit/targetlist",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({Targetlist: {search: 'ag', limit: 201,
            offset: 0}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/targetlist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {Targetlist: {search: 'ag', limit: 201, offset: 0}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/audit/targetlist");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "Targetlist": {
                "search": "ag",
                "limit": 201,
                "offset": 0
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/targetlist',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {Targetlist: {search: 'ag', limit: 201, offset: 0}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/audit/targetlist';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Targetlist":{"search":"ag","limit":201,"offset":0}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Targetlist":{"search":"ag","limit":201,"offset":0}}'
            };

            fetch('https://{baseurl}/api/audit/targetlist', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/audit/targetlist",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Targetlist": {
                "search": "ag",
                "limit": 201,
                "offset": 0
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/audit/targetlist");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/audit/targetlist", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/audit/targetlist"


            payload = {"Targetlist": {
                    "search": "ag",
                    "limit": 201,
                    "offset": 0
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/audit/targetlist")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/audit/targetlist",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/audit/targetlist');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Targetlist":{"search":"ag","limit":201,"offset":0}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Targetlist":{"search":"ag","limit":201,"offset":0}}');


            $request->setRequestUrl('https://{baseurl}/api/audit/targetlist');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/audit/targetlist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/audit/targetlist")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/audit/targetlist\"\n\n\tpayload := strings.NewReader(\"{\\\"Targetlist\\\":{\\\"search\\\":\\\"ag\\\",\\\"limit\\\":201,\\\"offset\\\":0}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/audit/targetlist");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Targetlist": @{ @"search": @"ag",
            @"limit": @201, @"offset": @0 } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/audit/targetlist"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Targetlist": [
                "search": "ag",
                "limit": 201,
                "offset": 0
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/audit/targetlist")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/audit/targetlist");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/audit/targetlist"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/audit/targetlist' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Targetlist":{"search":"ag","limit":201,"offset":0}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/audit/targetlist' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"Targetlist":{"search":"ag","limit":201,"offset":0}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/audit/targetlist"


            payload <-
            "{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/audit/targetlist" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Targetlist\":{\"search\":\"ag\",\"limit\":201,\"offset\":0}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/audit/targetlist")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/audit/export:
    post:
      tags:
        - Audit
      summary: Audit CSV Export
      operationId: exportAuditExport
      description: >-
        This API is used to generate CSV file based on the parameters. Make use
        of `Events\Download Events Exported CSV` API to download the exported
        CSV.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Query:
                  $ref: '#/components/schemas/ExportCSV'
                reason:
                  type: string
                  description: >-
                    Reason for exporting audit data (Supported in v1.0.1 and
                    later)
                  example: For compliance
            example:
              Query:
                offset: 0
                conditions:
                  - column: DATE
                    operator: 3
                    values:
                      - '2024-02-17T16:00:00.000Z'
                      - '2024-03-18T15:59:59.000Z'
                columns:
                  - DATE
                  - USRID
                  - PERM
                  - IP
                  - MENU
                  - TARGET
                  - METHOD
                  - CONTENT
                headers:
                  - Datetime
                  - User
                  - Operator Level
                  - IP
                  - Category
                  - Target
                  - Action
                  - Modification
      parameters:
        - name: time_offset
          in: query
          schema:
            type: integer
          description: >-
            Adjust the time value according to the required Time Zone. If the
            required TZ is UTC+8, then the value will be 480 (60 x 8).
          example: 480
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/audit/export?time_offset=480' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"offset":0,"columns":["string"],"headers":["string"]},"reason":"For compliance"}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"offset":0,"columns":["string"],"headers":["string"]},"reason":"For
            compliance"}' |  \
              http POST 'https://{baseurl}/api/audit/export?time_offset=480' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"offset":0,"columns":["string"],"headers":["string"]},"reason":"For compliance"}' \
              --output-document \
              - 'https://{baseurl}/api/audit/export?time_offset=480'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/audit/export?time_offset=480",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Query: {
                conditions: [{column: 'string', operator: 0, values: ['string']}],
                offset: 0,
                columns: ['string'],
                headers: ['string']
              },
              reason: 'For compliance'
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/export',
              qs: {time_offset: '480'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Query: {
                  conditions: [{column: 'string', operator: 0, values: ['string']}],
                  offset: 0,
                  columns: ['string'],
                  headers: ['string']
                },
                reason: 'For compliance'
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/audit/export");

            req.query({
              "time_offset": "480"
            });

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Query": {
                "conditions": [
                  {
                    "column": "string",
                    "operator": 0,
                    "values": [
                      "string"
                    ]
                  }
                ],
                "offset": 0,
                "columns": [
                  "string"
                ],
                "headers": [
                  "string"
                ]
              },
              "reason": "For compliance"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/audit/export',
              params: {time_offset: '480'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Query: {
                  conditions: [{column: 'string', operator: 0, values: ['string']}],
                  offset: 0,
                  columns: ['string'],
                  headers: ['string']
                },
                reason: 'For compliance'
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/audit/export?time_offset=480';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"offset":0,"columns":["string"],"headers":["string"]},"reason":"For compliance"}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"offset":0,"columns":["string"],"headers":["string"]},"reason":"For compliance"}'
            };

            fetch('https://{baseurl}/api/audit/export?time_offset=480', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/audit/export?time_offset=480",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For compliance\"}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "Query": {
                "conditions": [
                  {
                    "column": "string",
                    "operator": 0,
                    "values": [
                      "string"
                    ]
                  }
                ],
                "offset": 0,
                "columns": [
                  "string"
                ],
                "headers": [
                  "string"
                ]
              },
              "reason": "For compliance"
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/audit/export?time_offset=480");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For
            compliance\"}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/audit/export?time_offset=480",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/audit/export"


            querystring = {"time_offset":"480"}


            payload = {
                "Query": {
                    "conditions": [
                        {
                            "column": "string",
                            "operator": 0,
                            "values": ["string"]
                        }
                    ],
                    "offset": 0,
                    "columns": ["string"],
                    "headers": ["string"]
                },
                "reason": "For compliance"
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/audit/export?time_offset=480")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For
            compliance\"}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/audit/export?time_offset=480",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For compliance\"}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/audit/export');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'time_offset' => '480'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"offset":0,"columns":["string"],"headers":["string"]},"reason":"For
            compliance"}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"offset":0,"columns":["string"],"headers":["string"]},"reason":"For
            compliance"}');


            $request->setRequestUrl('https://{baseurl}/api/audit/export');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'time_offset' => '480'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For
            compliance\"}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/audit/export?time_offset=480")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/audit/export?time_offset=480")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For compliance\"}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/audit/export?time_offset=480\"\n\n\tpayload := strings.NewReader(\"{\\\"Query\\\":{\\\"conditions\\\":[{\\\"column\\\":\\\"string\\\",\\\"operator\\\":0,\\\"values\\\":[\\\"string\\\"]}],\\\"offset\\\":0,\\\"columns\\\":[\\\"string\\\"],\\\"headers\\\":[\\\"string\\\"]},\\\"reason\\\":\\\"For compliance\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/audit/export?time_offset=480");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For
            compliance\"}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Query": @{ @"conditions": @[ @{
            @"column": @"string", @"operator": @0, @"values": @[ @"string" ] }
            ], @"offset": @0, @"columns": @[ @"string" ], @"headers": @[
            @"string" ] },
                                          @"reason": @"For compliance" };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/audit/export?time_offset=480"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "Query": [
                "conditions": [
                  [
                    "column": "string",
                    "operator": 0,
                    "values": ["string"]
                  ]
                ],
                "offset": 0,
                "columns": ["string"],
                "headers": ["string"]
              ],
              "reason": "For compliance"
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/audit/export?time_offset=480")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/audit/export?time_offset=480");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For
            compliance\"}", ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/audit/export?time_offset=480"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For compliance\"}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/audit/export?time_offset=480' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"offset":0,"columns":["string"],"headers":["string"]},"reason":"For
            compliance"}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/audit/export?time_offset=480' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"Query":{"conditions":[{"column":"string","operator":0,"values":["string"]}],"offset":0,"columns":["string"],"headers":["string"]},"reason":"For
            compliance"}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/audit/export"


            queryString <- list([ 'time_offset' ] = "480")


            payload <-
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For
            compliance\"}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/audit/export?time_offset=480" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For
            compliance\"}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Query\":{\"conditions\":[{\"column\":\"string\",\"operator\":0,\"values\":[\"string\"]}],\"offset\":0,\"columns\":[\"string\"],\"headers\":[\"string\"]},\"reason\":\"For
            compliance\"}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/audit/export?time_offset=480")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/zones/occupancy:
    post:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: Create New'
      operationId: createZonesOccupancy
      description: >-
        Create and manage occupancy limit zones to control population density in
        specific areas and prevent overcrowding.


        You can monitor occupancy status and set alerts when zones reach
        capacity.


        **Capacity:** Up to 100 occupancy limit zones can be added.


        **Compatible Devices:**

        - FaceStation F2 firmware version 1.1.0 or later

        - FaceStation 2 firmware version 1.5.0 or later


        **Important Notes:**

        - A device cannot be assigned to both entry and exit simultaneously

        - Maximum 128 entry and exit devices combined

        - Devices using Dual Authentication cannot be set as entry or exit
        devices

        - Auto Count Reset time is based on UTC for the zone's location

        - Alert values must be smaller than the limit value and different from
        each other

        - Count Bypass feature is not available when using Thermal & Mask Check
        Mode without authentication

        - Up to 16 bypass groups can be added
      parameters:
        - name: time_zone
          in: query
          required: false
          schema:
            type: integer
            description: >-
              Time Zone ID for system operations. Affects timing calculations
              based on UTC offset.


              **Available Time Zones:**

              | ID | Offset | Description | ID | Offset | Description |

              |---|---|---|---|---|---|

              | 0 | -720 | UTC-12:00 | 17 | +210 | UTC+03:30 |

              | 1 | -660 | UTC-11:00 | 18 | +240 | UTC+04:00 |

              | 2 | -600 | UTC-10:00 | 19 | +270 | UTC+04:30 |

              | 3-1 | -570 | UTC-09:30 | 20 | +300 | UTC+05:00 |

              | 3 | -540 | UTC-09:00 | 21 | +330 | UTC+05:30 |

              | 4 | -480 | UTC-08:00 | 22 | +345 | UTC+05:45 |

              | 5 | -420 | UTC-07:00 | 23 | +360 | UTC+06:00 |

              | 6 | -360 | UTC-06:00 | 23+1 | +390 | UTC+06:30 |

              | 7 | -300 | UTC-05:00 | 24 | +420 | UTC+07:00 |

              | 8-1 | -270 | UTC-04:30 | 25 | +480 | UTC+08:00 |

              | 8 | -240 | UTC-04:00 | 25+1 | +510 | UTC+08:30 |

              | 9 | -210 | UTC-03:30 | 25+2 | +525 | UTC+08:45 |

              | 10 | -180 | UTC-03:00 | 26 | +540 | UTC+09:00 (Default) |

              | 11 | -120 | UTC-02:00 | 27 | +570 | UTC+09:30 |

              | 12 | -60 | UTC-01:00 | 28 | +600 | UTC+10:00 |

              | 13 | 0 | UTC±00:00 | 28+1 | +630 | UTC+10:30 |

              | 14 | +60 | UTC+01:00 | 29 | +660 | UTC+11:00 |

              | 15 | +120 | UTC+02:00 | 30 | +720 | UTC+12:00 |

              | 16 | +180 | UTC+03:00 | 30+1 | +765 | UTC+12:45 |

              | | | | 31 | +780 | UTC+13:00 |

              | | | | 32 | +840 | UTC+14:00 |
            default: 26
            example: 25
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OccupancyZoneInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url 'https://{baseurl}/api/v2/zones/occupancy?time_zone=25' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
            |  \
              http POST 'https://{baseurl}/api/v2/zones/occupancy?time_zone=25' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}' \
              --output-document \
              - 'https://{baseurl}/api/v2/zones/occupancy?time_zone=25'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy?time_zone=25",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              is_enabled: 1,
              name: 'OccupancyZone1',
              zone_type: 11,
              status: 0,
              occupancy_detail: {
                limit_count: 100,
                entry_devices: ['543720368'],
                exit_devices: ['542353521'],
                almost_full_alert_setting: {level: 1, step_1: 95, step_2: 0},
                auto_reset_count_time: {is_enabled: 1, minute: 1439},
                network_fail_action: 0,
                bypass_groups: [{acsgruid: 1}]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/zones/occupancy',
              qs: {time_zone: '25'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                is_enabled: 1,
                name: 'OccupancyZone1',
                zone_type: 11,
                status: 0,
                occupancy_detail: {
                  limit_count: 100,
                  entry_devices: ['543720368'],
                  exit_devices: ['542353521'],
                  almost_full_alert_setting: {level: 1, step_1: 95, step_2: 0},
                  auto_reset_count_time: {is_enabled: 1, minute: 1439},
                  network_fail_action: 0,
                  bypass_groups: [{acsgruid: 1}]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/zones/occupancy");


            req.query({
              "time_zone": "25"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "is_enabled": 1,
              "name": "OccupancyZone1",
              "zone_type": 11,
              "status": 0,
              "occupancy_detail": {
                "limit_count": 100,
                "entry_devices": [
                  "543720368"
                ],
                "exit_devices": [
                  "542353521"
                ],
                "almost_full_alert_setting": {
                  "level": 1,
                  "step_1": 95,
                  "step_2": 0
                },
                "auto_reset_count_time": {
                  "is_enabled": 1,
                  "minute": 1439
                },
                "network_fail_action": 0,
                "bypass_groups": [
                  {
                    "acsgruid": 1
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/zones/occupancy',
              params: {time_zone: '25'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                is_enabled: 1,
                name: 'OccupancyZone1',
                zone_type: 11,
                status: 0,
                occupancy_detail: {
                  limit_count: 100,
                  entry_devices: ['543720368'],
                  exit_devices: ['542353521'],
                  almost_full_alert_setting: {level: 1, step_1: 95, step_2: 0},
                  auto_reset_count_time: {is_enabled: 1, minute: 1439},
                  network_fail_action: 0,
                  bypass_groups: [{acsgruid: 1}]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/zones/occupancy?time_zone=25';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
            };


            fetch('https://{baseurl}/api/v2/zones/occupancy?time_zone=25',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy?time_zone=25",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "is_enabled": 1,
              "name": "OccupancyZone1",
              "zone_type": 11,
              "status": 0,
              "occupancy_detail": {
                "limit_count": 100,
                "entry_devices": [
                  "543720368"
                ],
                "exit_devices": [
                  "542353521"
                ],
                "almost_full_alert_setting": {
                  "level": 1,
                  "step_1": 95,
                  "step_2": 0
                },
                "auto_reset_count_time": {
                  "is_enabled": 1,
                  "minute": 1439
                },
                "network_fail_action": 0,
                "bypass_groups": [
                  {
                    "acsgruid": 1
                  }
                ]
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("POST",
            "https://{baseurl}/api/v2/zones/occupancy?time_zone=25");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST",
            "{baseurl}/api/v2/zones/occupancy?time_zone=25", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/zones/occupancy"


            querystring = {"time_zone":"25"}


            payload = {
                "is_enabled": 1,
                "name": "OccupancyZone1",
                "zone_type": 11,
                "status": 0,
                "occupancy_detail": {
                    "limit_count": 100,
                    "entry_devices": ["543720368"],
                    "exit_devices": ["542353521"],
                    "almost_full_alert_setting": {
                        "level": 1,
                        "step_1": 95,
                        "step_2": 0
                    },
                    "auto_reset_count_time": {
                        "is_enabled": 1,
                        "minute": 1439
                    },
                    "network_fail_action": 0,
                    "bypass_groups": [{"acsgruid": 1}]
                }
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/zones/occupancy?time_zone=25")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy?time_zone=25",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy');

            $request->setMethod(HTTP_METH_POST);


            $request->setQueryData([
              'time_zone' => '25'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}');


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'time_zone' => '25'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy?time_zone=25")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/zones/occupancy?time_zone=25")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy?time_zone=25\"\n\n\tpayload := strings.NewReader(\"{\\\"is_enabled\\\":1,\\\"name\\\":\\\"OccupancyZone1\\\",\\\"zone_type\\\":11,\\\"status\\\":0,\\\"occupancy_detail\\\":{\\\"limit_count\\\":100,\\\"entry_devices\\\":[\\\"543720368\\\"],\\\"exit_devices\\\":[\\\"542353521\\\"],\\\"almost_full_alert_setting\\\":{\\\"level\\\":1,\\\"step_1\\\":95,\\\"step_2\\\":0},\\\"auto_reset_count_time\\\":{\\\"is_enabled\\\":1,\\\"minute\\\":1439},\\\"network_fail_action\\\":0,\\\"bypass_groups\\\":[{\\\"acsgruid\\\":1}]}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy?time_zone=25");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"is_enabled": @1,
                                          @"name": @"OccupancyZone1",
                                          @"zone_type": @11,
                                          @"status": @0,
                                          @"occupancy_detail": @{ @"limit_count": @100, @"entry_devices": @[ @"543720368" ], @"exit_devices": @[ @"542353521" ], @"almost_full_alert_setting": @{ @"level": @1, @"step_1": @95, @"step_2": @0 }, @"auto_reset_count_time": @{ @"is_enabled": @1, @"minute": @1439 }, @"network_fail_action": @0, @"bypass_groups": @[ @{ @"acsgruid": @1 } ] } };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy?time_zone=25"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "is_enabled": 1,
              "name": "OccupancyZone1",
              "zone_type": 11,
              "status": 0,
              "occupancy_detail": [
                "limit_count": 100,
                "entry_devices": ["543720368"],
                "exit_devices": ["542353521"],
                "almost_full_alert_setting": [
                  "level": 1,
                  "step_1": 95,
                  "step_2": 0
                ],
                "auto_reset_count_time": [
                  "is_enabled": 1,
                  "minute": 1439
                ],
                "network_fail_action": 0,
                "bypass_groups": [["acsgruid": 1]]
              ]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy?time_zone=25")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy?time_zone=25");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy?time_zone=25"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy?time_zone=25' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy?time_zone=25' -Method POST
            -Headers $headers -ContentType 'application/json' -Body
            '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy"


            queryString <- list([ 'time_zone' ] = "25")


            payload <-
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy?time_zone=25" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy?time_zone=25")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: Delete'
      operationId: deleteZonesOccupancy
      description: This API is used to delete Occupancy Zone.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url https://{baseurl}/api/v2/zones/occupancy \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE https://{baseurl}/api/v2/zones/occupancy \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/zones/occupancy
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/v2/zones/occupancy',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/v2/zones/occupancy");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/v2/zones/occupancy',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/zones/occupancy';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/zones/occupancy', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/v2/zones/occupancy");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/v2/zones/occupancy",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/zones/occupancy"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("DELETE", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/zones/occupancy")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy');
            $request->setRequestMethod('DELETE');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/v2/zones/occupancy")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy' -Method DELETE -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy' -Method DELETE -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy"


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/zones/occupancy"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: List All'
      operationId: getZonesOccupancy
      description: This API is used to list all configured Occupancy Zone.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/zones/occupancy \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/zones/occupancy \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/zones/occupancy
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/zones/occupancy',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/zones/occupancy");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/zones/occupancy',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/zones/occupancy';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/zones/occupancy', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/v2/zones/occupancy");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/zones/occupancy",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/zones/occupancy"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/zones/occupancy")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/zones/occupancy")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/zones/occupancy"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/zones/occupancy/{id}:
    put:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: Update'
      operationId: updateZonesOccupancy
      description: This API is used to update occupancy zone configuration.
      parameters:
        - name: time_zone
          in: query
          required: false
          schema:
            type: integer
            description: >-
              Time Zone ID for system operations. Affects timing calculations
              based on UTC offset.


              **Available Time Zones:**

              | ID | Offset | Description | ID | Offset | Description |

              |---|---|---|---|---|---|

              | 0 | -720 | UTC-12:00 | 17 | +210 | UTC+03:30 |

              | 1 | -660 | UTC-11:00 | 18 | +240 | UTC+04:00 |

              | 2 | -600 | UTC-10:00 | 19 | +270 | UTC+04:30 |

              | 3-1 | -570 | UTC-09:30 | 20 | +300 | UTC+05:00 |

              | 3 | -540 | UTC-09:00 | 21 | +330 | UTC+05:30 |

              | 4 | -480 | UTC-08:00 | 22 | +345 | UTC+05:45 |

              | 5 | -420 | UTC-07:00 | 23 | +360 | UTC+06:00 |

              | 6 | -360 | UTC-06:00 | 23+1 | +390 | UTC+06:30 |

              | 7 | -300 | UTC-05:00 | 24 | +420 | UTC+07:00 |

              | 8-1 | -270 | UTC-04:30 | 25 | +480 | UTC+08:00 |

              | 8 | -240 | UTC-04:00 | 25+1 | +510 | UTC+08:30 |

              | 9 | -210 | UTC-03:30 | 25+2 | +525 | UTC+08:45 |

              | 10 | -180 | UTC-03:00 | 26 | +540 | UTC+09:00 (Default) |

              | 11 | -120 | UTC-02:00 | 27 | +570 | UTC+09:30 |

              | 12 | -60 | UTC-01:00 | 28 | +600 | UTC+10:00 |

              | 13 | 0 | UTC±00:00 | 28+1 | +630 | UTC+10:30 |

              | 14 | +60 | UTC+01:00 | 29 | +660 | UTC+11:00 |

              | 15 | +120 | UTC+02:00 | 30 | +720 | UTC+12:00 |

              | 16 | +180 | UTC+03:00 | 30+1 | +765 | UTC+12:45 |

              | | | | 31 | +780 | UTC+13:00 |

              | | | | 32 | +840 | UTC+14:00 |
            default: 26
            example: 25
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the occupancy zone which will be updated.
          example: 32784
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OccupancyZoneInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url 'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25' \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
            |  \
              http PUT 'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25' \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}' \
              --output-document \
              - 'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy/32784?time_zone=25",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              is_enabled: 1,
              name: 'OccupancyZone1',
              zone_type: 11,
              status: 0,
              occupancy_detail: {
                limit_count: 100,
                entry_devices: ['543720368'],
                exit_devices: ['542353521'],
                almost_full_alert_setting: {level: 1, step_1: 95, step_2: 0},
                auto_reset_count_time: {is_enabled: 1, minute: 1439},
                network_fail_action: 0,
                bypass_groups: [{acsgruid: 1}]
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/32784',
              qs: {time_zone: '25'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                is_enabled: 1,
                name: 'OccupancyZone1',
                zone_type: 11,
                status: 0,
                occupancy_detail: {
                  limit_count: 100,
                  entry_devices: ['543720368'],
                  exit_devices: ['542353521'],
                  almost_full_alert_setting: {level: 1, step_1: 95, step_2: 0},
                  auto_reset_count_time: {is_enabled: 1, minute: 1439},
                  network_fail_action: 0,
                  bypass_groups: [{acsgruid: 1}]
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/v2/zones/occupancy/32784");


            req.query({
              "time_zone": "25"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "is_enabled": 1,
              "name": "OccupancyZone1",
              "zone_type": 11,
              "status": 0,
              "occupancy_detail": {
                "limit_count": 100,
                "entry_devices": [
                  "543720368"
                ],
                "exit_devices": [
                  "542353521"
                ],
                "almost_full_alert_setting": {
                  "level": 1,
                  "step_1": 95,
                  "step_2": 0
                },
                "auto_reset_count_time": {
                  "is_enabled": 1,
                  "minute": 1439
                },
                "network_fail_action": 0,
                "bypass_groups": [
                  {
                    "acsgruid": 1
                  }
                ]
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/32784',
              params: {time_zone: '25'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                is_enabled: 1,
                name: 'OccupancyZone1',
                zone_type: 11,
                status: 0,
                occupancy_detail: {
                  limit_count: 100,
                  entry_devices: ['543720368'],
                  exit_devices: ['542353521'],
                  almost_full_alert_setting: {level: 1, step_1: 95, step_2: 0},
                  auto_reset_count_time: {is_enabled: 1, minute: 1439},
                  network_fail_action: 0,
                  bypass_groups: [{acsgruid: 1}]
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25';


            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
            };


            fetch('https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "is_enabled": 1,
              "name": "OccupancyZone1",
              "zone_type": 11,
              "status": 0,
              "occupancy_detail": {
                "limit_count": 100,
                "entry_devices": [
                  "543720368"
                ],
                "exit_devices": [
                  "542353521"
                ],
                "almost_full_alert_setting": {
                  "level": 1,
                  "step_1": 95,
                  "step_2": 0
                },
                "auto_reset_count_time": {
                  "is_enabled": 1,
                  "minute": 1439
                },
                "network_fail_action": 0,
                "bypass_groups": [
                  {
                    "acsgruid": 1
                  }
                ]
              }
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("PUT",
            "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT",
            "{baseurl}/api/v2/zones/occupancy/32784?time_zone=25", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/zones/occupancy/32784"


            querystring = {"time_zone":"25"}


            payload = {
                "is_enabled": 1,
                "name": "OccupancyZone1",
                "zone_type": 11,
                "status": 0,
                "occupancy_detail": {
                    "limit_count": 100,
                    "entry_devices": ["543720368"],
                    "exit_devices": ["542353521"],
                    "almost_full_alert_setting": {
                        "level": 1,
                        "step_1": 95,
                        "step_2": 0
                    },
                    "auto_reset_count_time": {
                        "is_enabled": 1,
                        "minute": 1439
                    },
                    "network_fail_action": 0,
                    "bypass_groups": [{"acsgruid": 1}]
                }
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers, params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy/32784');

            $request->setMethod(HTTP_METH_PUT);


            $request->setQueryData([
              'time_zone' => '25'
            ]);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}');


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy/32784');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setQuery(new http\QueryString([
              'time_zone' => '25'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25\"\n\n\tpayload := strings.NewReader(\"{\\\"is_enabled\\\":1,\\\"name\\\":\\\"OccupancyZone1\\\",\\\"zone_type\\\":11,\\\"status\\\":0,\\\"occupancy_detail\\\":{\\\"limit_count\\\":100,\\\"entry_devices\\\":[\\\"543720368\\\"],\\\"exit_devices\\\":[\\\"542353521\\\"],\\\"almost_full_alert_setting\\\":{\\\"level\\\":1,\\\"step_1\\\":95,\\\"step_2\\\":0},\\\"auto_reset_count_time\\\":{\\\"is_enabled\\\":1,\\\"minute\\\":1439},\\\"network_fail_action\\\":0,\\\"bypass_groups\\\":[{\\\"acsgruid\\\":1}]}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"is_enabled": @1,
                                          @"name": @"OccupancyZone1",
                                          @"zone_type": @11,
                                          @"status": @0,
                                          @"occupancy_detail": @{ @"limit_count": @100, @"entry_devices": @[ @"543720368" ], @"exit_devices": @[ @"542353521" ], @"almost_full_alert_setting": @{ @"level": @1, @"step_1": @95, @"step_2": @0 }, @"auto_reset_count_time": @{ @"is_enabled": @1, @"minute": @1439 }, @"network_fail_action": @0, @"bypass_groups": @[ @{ @"acsgruid": @1 } ] } };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "is_enabled": 1,
              "name": "OccupancyZone1",
              "zone_type": 11,
              "status": 0,
              "occupancy_detail": [
                "limit_count": 100,
                "entry_devices": ["543720368"],
                "exit_devices": ["542353521"],
                "almost_full_alert_setting": [
                  "level": 1,
                  "step_1": 95,
                  "step_2": 0
                ],
                "auto_reset_count_time": [
                  "is_enabled": 1,
                  "minute": 1439
                ],
                "network_fail_action": 0,
                "bypass_groups": [["acsgruid": 1]]
              ]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25'
            -Method PUT -Headers $headers -ContentType 'application/json' -Body
            '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25'
            -Method PUT -Headers $headers -ContentType 'application/json' -Body
            '{"is_enabled":1,"name":"OccupancyZone1","zone_type":11,"status":0,"occupancy_detail":{"limit_count":100,"entry_devices":["543720368"],"exit_devices":["542353521"],"almost_full_alert_setting":{"level":1,"step_1":95,"step_2":0},"auto_reset_count_time":{"is_enabled":1,"minute":1439},"network_fail_action":0,"bypass_groups":[{"acsgruid":1}]}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy/32784"


            queryString <- list([ 'time_zone' ] = "25")


            payload <-
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '), query =
            queryString, content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"is_enabled\":1,\"name\":\"OccupancyZone1\",\"zone_type\":11,\"status\":0,\"occupancy_detail\":{\"limit_count\":100,\"entry_devices\":[\"543720368\"],\"exit_devices\":[\"542353521\"],\"almost_full_alert_setting\":{\"level\":1,\"step_1\":95,\"step_2\":0},\"auto_reset_count_time\":{\"is_enabled\":1,\"minute\":1439},\"network_fail_action\":0,\"bypass_groups\":[{\"acsgruid\":1}]}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: View Details'
      operationId: occupancyViewDetails
      description: This API is used to view details of an Occupancy Zone.
      parameters:
        - name: time_zone
          in: query
          schema:
            type: integer
          example: 25
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Occupancy Zone which will be viewed.
          example: 32784
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url 'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http GET
            'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy/32784?time_zone=25",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/zones/occupancy/32784',
              qs: {time_zone: '25'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/zones/occupancy/32784");


            req.query({
              "time_zone": "25"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/zones/occupancy/32784',
              params: {time_zone: '25'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/v2/zones/occupancy/32784?time_zone=25",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/zones/occupancy/32784"


            querystring = {"time_zone":"25"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("GET", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Get.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy/32784');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'time_zone' => '25'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy/32784');

            $request->setRequestMethod('GET');

            $request->setQuery(new http\QueryString([
              'time_zone' => '25'
            ]));


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy/32784"


            queryString <- list([ 'time_zone' ] = "25")


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/32784?time_zone=25")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/zones/occupancy/search/{id}:
    get:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: Search by Name'
      operationId: getZonesOccupancySearch
      description: This API is used to search Occupancy Zone by name.
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: Name of the Occupancy Zone which will be searched.
          example: occ
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/zones/occupancy/search/occ \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/zones/occupancy/search/occ \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/zones/occupancy/search/occ
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy/search/occ",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/zones/occupancy/search/occ',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/zones/occupancy/search/occ");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/zones/occupancy/search/occ',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/zones/occupancy/search/occ';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/zones/occupancy/search/occ',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy/search/occ",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/zones/occupancy/search/occ");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/zones/occupancy/search/occ",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/zones/occupancy/search/occ"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/zones/occupancy/search/occ")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy/search/occ",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy/search/occ');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy/search/occ');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/search/occ")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/zones/occupancy/search/occ")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy/search/occ\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy/search/occ");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy/search/occ"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy/search/occ")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy/search/occ");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy/search/occ"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy/search/occ' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy/search/occ' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy/search/occ"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy/search/occ" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/search/occ")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/zones/occupancy/devices/dual:
    get:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: List Dual Auth. Devices'
      operationId: getZonesOccupancyDeviceDual
      description: This API is used to get a list of dual authentication devices.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/zones/occupancy/devices/dual \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/zones/occupancy/devices/dual \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/zones/occupancy/devices/dual
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy/devices/dual",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/zones/occupancy/devices/dual',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/zones/occupancy/devices/dual");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/zones/occupancy/devices/dual',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/zones/occupancy/devices/dual';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/zones/occupancy/devices/dual',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy/devices/dual",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/zones/occupancy/devices/dual");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/zones/occupancy/devices/dual",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/zones/occupancy/devices/dual"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/zones/occupancy/devices/dual")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy/devices/dual",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy/devices/dual');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy/devices/dual');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/devices/dual")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/zones/occupancy/devices/dual")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy/devices/dual\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy/devices/dual");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy/devices/dual"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy/devices/dual")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy/devices/dual");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy/devices/dual"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy/devices/dual' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy/devices/dual' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy/devices/dual"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy/devices/dual" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/devices/dual")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/zones/occupancy/devices/{id}:
    get:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: View Assigned Devices'
      operationId: listZonesOccupancyDevice
      description: This API is used to list assigned devices on a Occupancy Zone.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Occupancy Zone
          example: 32784
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/zones/occupancy/devices/32784 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/zones/occupancy/devices/32784 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/zones/occupancy/devices/32784
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy/devices/32784",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/zones/occupancy/devices/32784',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/zones/occupancy/devices/32784");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/zones/occupancy/devices/32784',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/zones/occupancy/devices/32784';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/zones/occupancy/devices/32784',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy/devices/32784",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("GET",
            "https://{baseurl}/api/v2/zones/occupancy/devices/32784");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET",
            "{baseurl}/api/v2/zones/occupancy/devices/32784", headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/zones/occupancy/devices/32784"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/zones/occupancy/devices/32784")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy/devices/32784",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy/devices/32784');

            $request->setMethod(HTTP_METH_GET);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy/devices/32784');

            $request->setRequestMethod('GET');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/devices/32784")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/zones/occupancy/devices/32784")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy/devices/32784\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy/devices/32784");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy/devices/32784"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy/devices/32784")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy/devices/32784");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy/devices/32784"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy/devices/32784' -Method GET
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy/devices/32784' -Method GET
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy/devices/32784"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy/devices/32784" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/devices/32784")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/zones/occupancy/count/increase/{id}:
    put:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: Increase Count'
      operationId: updateZonesOccupancyCountIncrease
      description: >-
        This API is used to increase an occupancy count.


        Count will be higher or equal to 0 and will be lower or equal to Count
        Limit.
      requestBody:
        content: {}
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Occupancy Limit.
          example: 32784
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/v2/zones/occupancy/count/increase/32784 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http PUT
            https://{baseurl}/api/v2/zones/occupancy/count/increase/32784 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/zones/occupancy/count/increase/32784
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy/count/increase/32784",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/count/increase/32784',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/v2/zones/occupancy/count/increase/32784");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/count/increase/32784',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/zones/occupancy/count/increase/32784';


            let options = {method: 'PUT', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'PUT', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/zones/occupancy/count/increase/32784',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy/count/increase/32784",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("PUT",
            "https://{baseurl}/api/v2/zones/occupancy/count/increase/32784");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("PUT",
            "{baseurl}/api/v2/zones/occupancy/count/increase/32784",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url =
            "https://{baseurl}/api/v2/zones/occupancy/count/increase/32784"


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("PUT", url, headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/zones/occupancy/count/increase/32784")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy/count/increase/32784",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy/count/increase/32784');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy/count/increase/32784');

            $request->setRequestMethod('PUT');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/count/increase/32784")
              .put(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/v2/zones/occupancy/count/increase/32784")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy/count/increase/32784\"\n\n\treq, _ := http.NewRequest(\"PUT\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy/count/increase/32784");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy/count/increase/32784"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy/count/increase/32784")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy/count/increase/32784");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy/count/increase/32784"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy/count/increase/32784'
            -Method PUT -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy/count/increase/32784'
            -Method PUT -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <-
            "https://{baseurl}/api/v2/zones/occupancy/count/increase/32784"


            response <- VERB("PUT", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy/count/increase/32784" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/count/increase/32784")
              .put(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/zones/occupancy/count/decrease/{id}:
    put:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: Decrease Count'
      operationId: updateZonesOccupancyCountDecrease
      description: >-
        This API is used to decrease an occupancy count.


        Count will be higher or equal to 0 and will be lower or equal to Count
        Limit.
      requestBody:
        content: {}
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Occupancy Limit
          example: 32784
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            http PUT
            https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy/count/decrease/32784",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784';


            let options = {method: 'PUT', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'PUT', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("PUT",
            "https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("PUT",
            "{baseurl}/api/v2/zones/occupancy/count/decrease/32784",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url =
            "https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784"


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("PUT", url, headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784');

            $request->setRequestMethod('PUT');

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784")
              .put(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784\"\n\n\treq, _ := http.NewRequest(\"PUT\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784")! as
            URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784'
            -Method PUT -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784'
            -Method PUT -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <-
            "https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784"


            response <- VERB("PUT", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/count/decrease/32784")
              .put(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/zones/occupancy/count/set/{id}:
    put:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: Set Count'
      operationId: updateZonesOccupancyCountSet
      description: >-
        This API is used to set and occupancy limit count.


        Count value will be higher or equal to 0 and will be lower or equal to
        Count Limit.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - count
              properties:
                count:
                  type: integer
                  description: Set count value
                  example: 85
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Occupancy Limit.
          example: 32784
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/v2/zones/occupancy/count/set/32784 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"count":85}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"count":85}' |  \
              http PUT https://{baseurl}/api/v2/zones/occupancy/count/set/32784 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"count":85}' \
              --output-document \
              - https://{baseurl}/api/v2/zones/occupancy/count/set/32784
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy/count/set/32784",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({count: 85}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/count/set/32784',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {count: 85},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/v2/zones/occupancy/count/set/32784");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "count": 85
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/count/set/32784',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {count: 85}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url =
            'https://{baseurl}/api/v2/zones/occupancy/count/set/32784';


            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"count":85}'
            };


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"count":85}'
            };


            fetch('https://{baseurl}/api/v2/zones/occupancy/count/set/32784',
            options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy/count/set/32784",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"count\":85}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = JSON.stringify({
              "count": 85
            });


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("PUT",
            "https://{baseurl}/api/v2/zones/occupancy/count/set/32784");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.setRequestHeader("content-type", "application/json");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"count\":85}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT",
            "{baseurl}/api/v2/zones/occupancy/count/set/32784", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/zones/occupancy/count/set/32784"


            payload = {"count": 85}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url =
            URI("https://{baseurl}/api/v2/zones/occupancy/count/set/32784")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"count\":85}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy/count/set/32784",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"count\":85}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy/count/set/32784');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"count":85}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"count":85}');


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy/count/set/32784');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            MediaType mediaType = MediaType.parse("application/json");
            RequestBody body = RequestBody.create(mediaType, "{\"count\":85}");
            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/count/set/32784")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/v2/zones/occupancy/count/set/32784")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"count\":85}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy/count/set/32784\"\n\n\tpayload := strings.NewReader(\"{\\\"count\\\":85}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy/count/set/32784");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"count\":85}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"count": @85 };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy/count/set/32784"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["count": 85] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy/count/set/32784")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy/count/set/32784");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json", "{\"count\":85}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy/count/set/32784"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"count\":85}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy/count/set/32784' -Method
            PUT -Headers $headers -ContentType 'application/json' -Body
            '{"count":85}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy/count/set/32784' -Method
            PUT -Headers $headers -ContentType 'application/json' -Body
            '{"count":85}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy/count/set/32784"


            payload <- "{\"count\":85}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy/count/set/32784" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string "{\"count\":85}" in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val mediaType = MediaType.parse("application/json")
            val body = RequestBody.create(mediaType, "{\"count\":85}")
            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/count/set/32784")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/zones/occupancy/reset:
    put:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: Reset Count'
      operationId: updateZonesOccupancyReset
      description: >-
        This API is used to reset current counts and bypass counts of the
        occupancy limit zone.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: integer
                  description: List of Occupancy Zone IDs which will be reset.
                  example:
                    - 32784
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/v2/zones/occupancy/reset \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ids":[32784]}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"ids":[32784]}' |  \
              http PUT https://{baseurl}/api/v2/zones/occupancy/reset \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ids":[32784]}' \
              --output-document \
              - https://{baseurl}/api/v2/zones/occupancy/reset
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy/reset",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({ids: [32784]}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/reset',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {ids: [32784]},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/v2/zones/occupancy/reset");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "ids": [
                32784
              ]
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/reset',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {ids: [32784]}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/zones/occupancy/reset';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ids":[32784]}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ids":[32784]}'
            };

            fetch('https://{baseurl}/api/v2/zones/occupancy/reset', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy/reset",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ids\":[32784]}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "ids": [
                32784
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/v2/zones/occupancy/reset");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"ids\":[32784]}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/v2/zones/occupancy/reset",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/zones/occupancy/reset"


            payload = {"ids": [32784]}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/zones/occupancy/reset")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Put.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"ids\":[32784]}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy/reset",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"ids\":[32784]}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy/reset');
            $request->setMethod(HTTP_METH_PUT);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"ids":[32784]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ids":[32784]}');


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy/reset');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ids\":[32784]}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/reset")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/v2/zones/occupancy/reset")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ids\":[32784]}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy/reset\"\n\n\tpayload := strings.NewReader(\"{\\\"ids\\\":[32784]}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy/reset");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"ids\":[32784]}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ids": @[ @32784 ] };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy/reset"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ids": [32784]] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy/reset")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy/reset");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json", "{\"ids\":[32784]}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy/reset"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ids\":[32784]}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy/reset' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"ids":[32784]}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy/reset' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"ids":[32784]}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy/reset"


            payload <- "{\"ids\":[32784]}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy/reset" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string "{\"ids\":[32784]}" in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val mediaType = MediaType.parse("application/json")
            val body = RequestBody.create(mediaType, "{\"ids\":[32784]}")
            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/reset")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/zones/occupancy/disable:
    put:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: Disable'
      operationId: updateZonesOccupancyDisable
      description: This API is used to disable Occupancy Limit Zone.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                ids:
                  - 32784
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/v2/zones/occupancy/disable \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ids":[32784]}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"ids":[32784]}' |  \
              http PUT https://{baseurl}/api/v2/zones/occupancy/disable \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ids":[32784]}' \
              --output-document \
              - https://{baseurl}/api/v2/zones/occupancy/disable
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy/disable",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({ids: [32784]}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/disable',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {ids: [32784]},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/v2/zones/occupancy/disable");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "ids": [
                32784
              ]
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/disable',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {ids: [32784]}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/zones/occupancy/disable';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ids":[32784]}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ids":[32784]}'
            };

            fetch('https://{baseurl}/api/v2/zones/occupancy/disable', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy/disable",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ids\":[32784]}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "ids": [
                32784
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/v2/zones/occupancy/disable");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"ids\":[32784]}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/v2/zones/occupancy/disable",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/zones/occupancy/disable"


            payload = {"ids": [32784]}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/zones/occupancy/disable")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Put.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"ids\":[32784]}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy/disable",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"ids\":[32784]}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy/disable');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"ids":[32784]}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ids":[32784]}');


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy/disable');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ids\":[32784]}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/disable")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/v2/zones/occupancy/disable")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ids\":[32784]}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy/disable\"\n\n\tpayload := strings.NewReader(\"{\\\"ids\\\":[32784]}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy/disable");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"ids\":[32784]}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ids": @[ @32784 ] };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy/disable"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ids": [32784]] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy/disable")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy/disable");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json", "{\"ids\":[32784]}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy/disable"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ids\":[32784]}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy/disable' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"ids":[32784]}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy/disable' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"ids":[32784]}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy/disable"


            payload <- "{\"ids\":[32784]}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy/disable" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string "{\"ids\":[32784]}" in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val mediaType = MediaType.parse("application/json")
            val body = RequestBody.create(mediaType, "{\"ids\":[32784]}")
            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/disable")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/zones/occupancy/enable:
    put:
      tags:
        - Occupancy Limit
      summary: 'Occupancy: Enable'
      operationId: updateZonesOccupancyEnable
      description: This API is used to enable Occupancy Limit Zone.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                ids:
                  - 32784
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/v2/zones/occupancy/enable \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"ids":[32784]}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"ids":[32784]}' |  \
              http PUT https://{baseurl}/api/v2/zones/occupancy/enable \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"ids":[32784]}' \
              --output-document \
              - https://{baseurl}/api/v2/zones/occupancy/enable
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/zones/occupancy/enable",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({ids: [32784]}));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/enable',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {ids: [32784]},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/v2/zones/occupancy/enable");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "ids": [
                32784
              ]
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/zones/occupancy/enable',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {ids: [32784]}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/zones/occupancy/enable';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ids":[32784]}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"ids":[32784]}'
            };

            fetch('https://{baseurl}/api/v2/zones/occupancy/enable', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/zones/occupancy/enable",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"ids\":[32784]}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "ids": [
                32784
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/v2/zones/occupancy/enable");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"ids\":[32784]}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/v2/zones/occupancy/enable",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/zones/occupancy/enable"


            payload = {"ids": [32784]}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/zones/occupancy/enable")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Put.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'
            request["content-type"] = 'application/json'
            request.body = "{\"ids\":[32784]}"

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/zones/occupancy/enable",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"ids\":[32784]}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/zones/occupancy/enable');
            $request->setMethod(HTTP_METH_PUT);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"ids":[32784]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"ids":[32784]}');


            $request->setRequestUrl('https://{baseurl}/api/v2/zones/occupancy/enable');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"ids\":[32784]}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/enable")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/v2/zones/occupancy/enable")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"ids\":[32784]}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/zones/occupancy/enable\"\n\n\tpayload := strings.NewReader(\"{\\\"ids\\\":[32784]}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/zones/occupancy/enable");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"ids\":[32784]}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"ids": @[ @32784 ] };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/zones/occupancy/enable"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["ids": [32784]] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/zones/occupancy/enable")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/zones/occupancy/enable");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json", "{\"ids\":[32784]}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/v2/zones/occupancy/enable"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"ids\":[32784]}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/zones/occupancy/enable' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"ids":[32784]}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/zones/occupancy/enable' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"ids":[32784]}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/zones/occupancy/enable"


            payload <- "{\"ids\":[32784]}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/zones/occupancy/enable" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string "{\"ids\":[32784]}" in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val mediaType = MediaType.parse("application/json")
            val body = RequestBody.create(mediaType, "{\"ids\":[32784]}")
            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/zones/occupancy/enable")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/zones:
    post:
      tags:
        - Zones
      summary: 'Interlock: Create'
      operationId: createZones
      description: >-
        Interlock zone monitors the status of two or more doors by door sensor
        and relay state to control that one door cannot be opened or close if
        other doors are open or unlocked. You can also disable access if a user
        stays within the zone.


        - An interlock zone can be configured with up to 4 doors.

        - An interlock zone can only set the doors with the devices connected to
        the CoreStation.
            
        - A device set as an interlock zone cannot be set to another zone.

        - A door set as an interlock zone cannot be set to another zone other
        than the fire alarm zone.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InterlockZoneInput'
            example:
              Zone:
                name: IN1
                description: ''
                zone_type: 7
                is_global: 0
                enable: 1
                inter_lock:
                  doors:
                    - id: 2
                    - id: 3
                  sensor_inputs:
                    - device:
                        id: 546091003
                      input_index: 0
                      duration: 300
                      normal_open: 0
                      input_type: input
                  alarm_actions:
                    - input_event_id: 41472
                      output_type: 3
                      output_device_id:
                        id: 546091003
                        buzzer: true
                      output_buzzer_volume: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/zones \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Zone":{"name":"IN1","description":"","zone_type":7,"is_global":0,"enable":1,"inter_lock":{"doors":[{"id":2}],"sensor_inputs":[{"device":{"id":546091003},"input_index":0,"duration":300,"normal_open":0,"input_type":"input"}],"alarm_actions":[{"input_event_id":41472,"output_type":3,"output_device_id":{"id":546091003,"buzzer":true},"output_buzzer_volume":1}]}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Zone":{"name":"IN1","description":"","zone_type":7,"is_global":0,"enable":1,"inter_lock":{"doors":[{"id":2}],"sensor_inputs":[{"device":{"id":546091003},"input_index":0,"duration":300,"normal_open":0,"input_type":"input"}],"alarm_actions":[{"input_event_id":41472,"output_type":3,"output_device_id":{"id":546091003,"buzzer":true},"output_buzzer_volume":1}]}}}'
            |  \
              http POST https://{baseurl}/api/zones \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Zone":{"name":"IN1","description":"","zone_type":7,"is_global":0,"enable":1,"inter_lock":{"doors":[{"id":2}],"sensor_inputs":[{"device":{"id":546091003},"input_index":0,"duration":300,"normal_open":0,"input_type":"input"}],"alarm_actions":[{"input_event_id":41472,"output_type":3,"output_device_id":{"id":546091003,"buzzer":true},"output_buzzer_volume":1}]}}}' \
              --output-document \
              - https://{baseurl}/api/zones
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/zones",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Zone: {
                name: 'IN1',
                description: '',
                zone_type: 7,
                is_global: 0,
                enable: 1,
                inter_lock: {
                  doors: [{id: 2}],
                  sensor_inputs: [
                    {
                      device: {id: 546091003},
                      input_index: 0,
                      duration: 300,
                      normal_open: 0,
                      input_type: 'input'
                    }
                  ],
                  alarm_actions: [
                    {
                      input_event_id: 41472,
                      output_type: 3,
                      output_device_id: {id: 546091003, buzzer: true},
                      output_buzzer_volume: 1
                    }
                  ]
                }
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/zones',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Zone: {
                  name: 'IN1',
                  description: '',
                  zone_type: 7,
                  is_global: 0,
                  enable: 1,
                  inter_lock: {
                    doors: [{id: 2}],
                    sensor_inputs: [
                      {
                        device: {id: 546091003},
                        input_index: 0,
                        duration: 300,
                        normal_open: 0,
                        input_type: 'input'
                      }
                    ],
                    alarm_actions: [
                      {
                        input_event_id: 41472,
                        output_type: 3,
                        output_device_id: {id: 546091003, buzzer: true},
                        output_buzzer_volume: 1
                      }
                    ]
                  }
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/zones");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Zone": {
                "name": "IN1",
                "description": "",
                "zone_type": 7,
                "is_global": 0,
                "enable": 1,
                "inter_lock": {
                  "doors": [
                    {
                      "id": 2
                    }
                  ],
                  "sensor_inputs": [
                    {
                      "device": {
                        "id": 546091003
                      },
                      "input_index": 0,
                      "duration": 300,
                      "normal_open": 0,
                      "input_type": "input"
                    }
                  ],
                  "alarm_actions": [
                    {
                      "input_event_id": 41472,
                      "output_type": 3,
                      "output_device_id": {
                        "id": 546091003,
                        "buzzer": true
                      },
                      "output_buzzer_volume": 1
                    }
                  ]
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/zones',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Zone: {
                  name: 'IN1',
                  description: '',
                  zone_type: 7,
                  is_global: 0,
                  enable: 1,
                  inter_lock: {
                    doors: [{id: 2}],
                    sensor_inputs: [
                      {
                        device: {id: 546091003},
                        input_index: 0,
                        duration: 300,
                        normal_open: 0,
                        input_type: 'input'
                      }
                    ],
                    alarm_actions: [
                      {
                        input_event_id: 41472,
                        output_type: 3,
                        output_device_id: {id: 546091003, buzzer: true},
                        output_buzzer_volume: 1
                      }
                    ]
                  }
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/zones';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Zone":{"name":"IN1","description":"","zone_type":7,"is_global":0,"enable":1,"inter_lock":{"doors":[{"id":2}],"sensor_inputs":[{"device":{"id":546091003},"input_index":0,"duration":300,"normal_open":0,"input_type":"input"}],"alarm_actions":[{"input_event_id":41472,"output_type":3,"output_device_id":{"id":546091003,"buzzer":true},"output_buzzer_volume":1}]}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Zone":{"name":"IN1","description":"","zone_type":7,"is_global":0,"enable":1,"inter_lock":{"doors":[{"id":2}],"sensor_inputs":[{"device":{"id":546091003},"input_index":0,"duration":300,"normal_open":0,"input_type":"input"}],"alarm_actions":[{"input_event_id":41472,"output_type":3,"output_device_id":{"id":546091003,"buzzer":true},"output_buzzer_volume":1}]}}}'
            };

            fetch('https://{baseurl}/api/zones', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/zones",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Zone": {
                "name": "IN1",
                "description": "",
                "zone_type": 7,
                "is_global": 0,
                "enable": 1,
                "inter_lock": {
                  "doors": [
                    {
                      "id": 2
                    }
                  ],
                  "sensor_inputs": [
                    {
                      "device": {
                        "id": 546091003
                      },
                      "input_index": 0,
                      "duration": 300,
                      "normal_open": 0,
                      "input_type": "input"
                    }
                  ],
                  "alarm_actions": [
                    {
                      "input_event_id": 41472,
                      "output_type": 3,
                      "output_device_id": {
                        "id": 546091003,
                        "buzzer": true
                      },
                      "output_buzzer_volume": 1
                    }
                  ]
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/zones");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/zones", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/zones"


            payload = {"Zone": {
                    "name": "IN1",
                    "description": "",
                    "zone_type": 7,
                    "is_global": 0,
                    "enable": 1,
                    "inter_lock": {
                        "doors": [{"id": 2}],
                        "sensor_inputs": [
                            {
                                "device": {"id": 546091003},
                                "input_index": 0,
                                "duration": 300,
                                "normal_open": 0,
                                "input_type": "input"
                            }
                        ],
                        "alarm_actions": [
                            {
                                "input_event_id": 41472,
                                "output_type": 3,
                                "output_device_id": {
                                    "id": 546091003,
                                    "buzzer": True
                                },
                                "output_buzzer_volume": 1
                            }
                        ]
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/zones")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/zones",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/zones');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Zone":{"name":"IN1","description":"","zone_type":7,"is_global":0,"enable":1,"inter_lock":{"doors":[{"id":2}],"sensor_inputs":[{"device":{"id":546091003},"input_index":0,"duration":300,"normal_open":0,"input_type":"input"}],"alarm_actions":[{"input_event_id":41472,"output_type":3,"output_device_id":{"id":546091003,"buzzer":true},"output_buzzer_volume":1}]}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Zone":{"name":"IN1","description":"","zone_type":7,"is_global":0,"enable":1,"inter_lock":{"doors":[{"id":2}],"sensor_inputs":[{"device":{"id":546091003},"input_index":0,"duration":300,"normal_open":0,"input_type":"input"}],"alarm_actions":[{"input_event_id":41472,"output_type":3,"output_device_id":{"id":546091003,"buzzer":true},"output_buzzer_volume":1}]}}}');


            $request->setRequestUrl('https://{baseurl}/api/zones');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/zones")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/zones")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/zones\"\n\n\tpayload := strings.NewReader(\"{\\\"Zone\\\":{\\\"name\\\":\\\"IN1\\\",\\\"description\\\":\\\"\\\",\\\"zone_type\\\":7,\\\"is_global\\\":0,\\\"enable\\\":1,\\\"inter_lock\\\":{\\\"doors\\\":[{\\\"id\\\":2}],\\\"sensor_inputs\\\":[{\\\"device\\\":{\\\"id\\\":546091003},\\\"input_index\\\":0,\\\"duration\\\":300,\\\"normal_open\\\":0,\\\"input_type\\\":\\\"input\\\"}],\\\"alarm_actions\\\":[{\\\"input_event_id\\\":41472,\\\"output_type\\\":3,\\\"output_device_id\\\":{\\\"id\\\":546091003,\\\"buzzer\\\":true},\\\"output_buzzer_volume\\\":1}]}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL, "https://{baseurl}/api/zones");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Zone": @{ @"name": @"IN1",
            @"description": @"", @"zone_type": @7, @"is_global": @0, @"enable":
            @1, @"inter_lock": @{ @"doors": @[ @{ @"id": @2 } ],
            @"sensor_inputs": @[ @{ @"device": @{ @"id": @546091003 },
            @"input_index": @0, @"duration": @300, @"normal_open": @0,
            @"input_type": @"input" } ], @"alarm_actions": @[ @{
            @"input_event_id": @41472, @"output_type": @3, @"output_device_id":
            @{ @"id": @546091003, @"buzzer": @YES }, @"output_buzzer_volume": @1
            } ] } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL URLWithString:@"https://{baseurl}/api/zones"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Zone": [
                "name": "IN1",
                "description": "",
                "zone_type": 7,
                "is_global": 0,
                "enable": 1,
                "inter_lock": [
                  "doors": [["id": 2]],
                  "sensor_inputs": [
                    [
                      "device": ["id": 546091003],
                      "input_index": 0,
                      "duration": 300,
                      "normal_open": 0,
                      "input_type": "input"
                    ]
                  ],
                  "alarm_actions": [
                    [
                      "input_event_id": 41472,
                      "output_type": 3,
                      "output_device_id": [
                        "id": 546091003,
                        "buzzer": true
                      ],
                      "output_buzzer_volume": 1
                    ]
                  ]
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/zones")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/zones");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/zones"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/zones'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Zone":{"name":"IN1","description":"","zone_type":7,"is_global":0,"enable":1,"inter_lock":{"doors":[{"id":2}],"sensor_inputs":[{"device":{"id":546091003},"input_index":0,"duration":300,"normal_open":0,"input_type":"input"}],"alarm_actions":[{"input_event_id":41472,"output_type":3,"output_device_id":{"id":546091003,"buzzer":true},"output_buzzer_volume":1}]}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/zones'
            -Method POST -Headers $headers -ContentType 'application/json' -Body
            '{"Zone":{"name":"IN1","description":"","zone_type":7,"is_global":0,"enable":1,"inter_lock":{"doors":[{"id":2}],"sensor_inputs":[{"device":{"id":546091003},"input_index":0,"duration":300,"normal_open":0,"input_type":"input"}],"alarm_actions":[{"input_event_id":41472,"output_type":3,"output_device_id":{"id":546091003,"buzzer":true},"output_buzzer_volume":1}]}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/zones"


            payload <-
            "{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/zones" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Zone\":{\"name\":\"IN1\",\"description\":\"\",\"zone_type\":7,\"is_global\":0,\"enable\":1,\"inter_lock\":{\"doors\":[{\"id\":2}],\"sensor_inputs\":[{\"device\":{\"id\":546091003},\"input_index\":0,\"duration\":300,\"normal_open\":0,\"input_type\":\"input\"}],\"alarm_actions\":[{\"input_event_id\":41472,\"output_type\":3,\"output_device_id\":{\"id\":546091003,\"buzzer\":true},\"output_buzzer_volume\":1}]}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/zones")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Zones
      summary: View Zones
      operationId: listZones
      description: This API is used to view zones.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/zones \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/zones \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/zones
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/zones",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/zones',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/zones");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/zones',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/zones';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/zones', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/zones",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/zones");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/zones", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/zones"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/zones")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/zones",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/zones');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/zones');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/zones")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/zones")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/zones\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL, "https://{baseurl}/api/zones");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL URLWithString:@"https://{baseurl}/api/zones"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/zones")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/zones");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/zones"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri 'https://{baseurl}/api/zones'
            -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri 'https://{baseurl}/api/zones'
            -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/zones"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/zones" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/zones")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/zones/clear_apb_ex:
    post:
      tags:
        - Zones
      summary: 'APB: Clear APB'
      operationId: createZonesClearApbEx
      description: >-
        This endpoint allows administrators to reset the Anti-Passback state
        within a zone. It can be applied either to **all users in the zone** or
        to a **specific set of users**


        **Response Codes:**


        - 200 OK: Request successful
            
        - 400 Bad Request (Code 671): Zone ID mismatch (zone not found)
            
        - 401 Unauthorized: Login required or invalid session token
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                AntiPassBackConfig:
                  type: object
                  required:
                    - Zone
                    - UserType
                  properties:
                    Zone:
                      type: object
                      required:
                        - ZoneCollection
                      properties:
                        ZoneCollection:
                          type: object
                          required:
                            - rows
                          properties:
                            rows:
                              type: array
                              items:
                                type: object
                                required:
                                  - id
                                properties:
                                  id:
                                    type: string
                                    description: The ID of the APB zone to be cleared.
                    UserType:
                      type: integer
                      description: |-
                        Specifies the clear mode:
                        - `1` = Clear APB for all users.
                        - `2` = Clear APB for specific users..
                User:
                  type: array
                  description: >-
                    List of user objects with user_id. Required when
                    UserType=`2`.
                  items:
                    type: object
                    required:
                      - user_id
                    properties:
                      user_id:
                        type: integer
              example:
                AntiPassBackConfig:
                  Zone:
                    ZoneCollection:
                      rows:
                        - id: '32774'
                  UserType: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
              example:
                Response:
                  code: '671'
                  link: https://support.supremainc.com/en/support/home
                  message: Zone type mismatch.
        '401':
          description: Unauthorized - The API key provided was invalid or missing.
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/zones/clear_apb_ex \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"AntiPassBackConfig":{"Zone":{"ZoneCollection":{"rows":[{"id":"32774"}]}},"UserType":1}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"AntiPassBackConfig":{"Zone":{"ZoneCollection":{"rows":[{"id":"32774"}]}},"UserType":1}}'
            |  \
              http POST https://{baseurl}/api/zones/clear_apb_ex \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"AntiPassBackConfig":{"Zone":{"ZoneCollection":{"rows":[{"id":"32774"}]}},"UserType":1}}' \
              --output-document \
              - https://{baseurl}/api/zones/clear_apb_ex
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/zones/clear_apb_ex",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              AntiPassBackConfig: {Zone: {ZoneCollection: {rows: [{id: '32774'}]}}, UserType: 1}
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/zones/clear_apb_ex',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                AntiPassBackConfig: {Zone: {ZoneCollection: {rows: [{id: '32774'}]}}, UserType: 1}
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/zones/clear_apb_ex");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "AntiPassBackConfig": {
                "Zone": {
                  "ZoneCollection": {
                    "rows": [
                      {
                        "id": "32774"
                      }
                    ]
                  }
                },
                "UserType": 1
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/zones/clear_apb_ex',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                AntiPassBackConfig: {Zone: {ZoneCollection: {rows: [{id: '32774'}]}}, UserType: 1}
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/zones/clear_apb_ex';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AntiPassBackConfig":{"Zone":{"ZoneCollection":{"rows":[{"id":"32774"}]}},"UserType":1}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"AntiPassBackConfig":{"Zone":{"ZoneCollection":{"rows":[{"id":"32774"}]}},"UserType":1}}'
            };

            fetch('https://{baseurl}/api/zones/clear_apb_ex', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/zones/clear_apb_ex",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "AntiPassBackConfig": {
                "Zone": {
                  "ZoneCollection": {
                    "rows": [
                      {
                        "id": "32774"
                      }
                    ]
                  }
                },
                "UserType": 1
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/zones/clear_apb_ex");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/zones/clear_apb_ex", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/zones/clear_apb_ex"


            payload = {"AntiPassBackConfig": {
                    "Zone": {"ZoneCollection": {"rows": [{"id": "32774"}]}},
                    "UserType": 1
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/zones/clear_apb_ex")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/zones/clear_apb_ex",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/zones/clear_apb_ex');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"AntiPassBackConfig":{"Zone":{"ZoneCollection":{"rows":[{"id":"32774"}]}},"UserType":1}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"AntiPassBackConfig":{"Zone":{"ZoneCollection":{"rows":[{"id":"32774"}]}},"UserType":1}}');


            $request->setRequestUrl('https://{baseurl}/api/zones/clear_apb_ex');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/zones/clear_apb_ex")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/zones/clear_apb_ex")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/zones/clear_apb_ex\"\n\n\tpayload := strings.NewReader(\"{\\\"AntiPassBackConfig\\\":{\\\"Zone\\\":{\\\"ZoneCollection\\\":{\\\"rows\\\":[{\\\"id\\\":\\\"32774\\\"}]}},\\\"UserType\\\":1}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/zones/clear_apb_ex");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"AntiPassBackConfig": @{ @"Zone": @{
            @"ZoneCollection": @{ @"rows": @[ @{ @"id": @"32774" } ] } },
            @"UserType": @1 } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/zones/clear_apb_ex"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["AntiPassBackConfig": [
                "Zone": ["ZoneCollection": ["rows": [["id": "32774"]]]],
                "UserType": 1
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/zones/clear_apb_ex")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/zones/clear_apb_ex");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/zones/clear_apb_ex"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/zones/clear_apb_ex' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"AntiPassBackConfig":{"Zone":{"ZoneCollection":{"rows":[{"id":"32774"}]}},"UserType":1}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/zones/clear_apb_ex' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"AntiPassBackConfig":{"Zone":{"ZoneCollection":{"rows":[{"id":"32774"}]}},"UserType":1}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/zones/clear_apb_ex"


            payload <-
            "{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/zones/clear_apb_ex"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"AntiPassBackConfig\":{\"Zone\":{\"ZoneCollection\":{\"rows\":[{\"id\":\"32774\"}]}},\"UserType\":1}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/zones/clear_apb_ex")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/zones/{id}:
    put:
      tags:
        - Zones
      summary: 'Zones: Update'
      operationId: updateZones
      description: This API is used to update a Zone.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Zone:
                  type: object
                  required:
                    - name
                    - zone_type
                    - is_global
                    - enable
                  properties:
                    name:
                      type: string
                      description: Enter the zone name.
                      minLength: 1
                      maxLength: 48
                      example: IN1
                    description:
                      type: string
                      description: Enter the zone description.
                      maxLength: 255
                      example: ''
                    zone_type:
                      type: integer
                      description: View the zone type.
                      example: 8
                    is_global:
                      type: integer
                      description: >-
                        You can check the application range of the zone. Only
                        Local mode is supported for interlock zone, and the zone
                        can be set only with devices connected to the
                        CoreStation and RS-485.
                      example: 1
                    enable:
                      type: integer
                      description: >-
                        You can disable the interlock zone. input `1` to enable
                        it.
                      example: 1
                    status:
                      type: integer
                      description: View the zone status.
                      example: 64
              example:
                Zone:
                  name: testmuster1
                  zone_type: 8
                  is_global: 1
                  enable: 1
                  status: 64
                  muster:
                    access_groups:
                      - id: '1'
                    entry_devices:
                      - id: '731'
                    exit_devices:
                      - id: '729'
                    time_limit: '1200'
                    alarm_actions: []
      parameters:
        - name: id
          in: path
          schema:
            type: string
          required: true
          description: ID of the Zone which will be updated.
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/zones/{id} \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"Zone":{"name":"testmuster1","zone_type":8,"is_global":1,"enable":1,"status":64,"muster":{"access_groups":[{"id":"1"}],"entry_devices":[{"id":"731"}],"exit_devices":[{"id":"729"}],"time_limit":"1200","alarm_actions":[]}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"Zone":{"name":"testmuster1","zone_type":8,"is_global":1,"enable":1,"status":64,"muster":{"access_groups":[{"id":"1"}],"entry_devices":[{"id":"731"}],"exit_devices":[{"id":"729"}],"time_limit":"1200","alarm_actions":[]}}}'
            |  \
              http PUT https://{baseurl}/api/zones/{id} \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"Zone":{"name":"testmuster1","zone_type":8,"is_global":1,"enable":1,"status":64,"muster":{"access_groups":[{"id":"1"}],"entry_devices":[{"id":"731"}],"exit_devices":[{"id":"729"}],"time_limit":"1200","alarm_actions":[]}}}' \
              --output-document \
              - https://{baseurl}/api/zones/{id}
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/zones/{id}",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              Zone: {
                name: 'testmuster1',
                zone_type: 8,
                is_global: 1,
                enable: 1,
                status: 64,
                muster: {
                  access_groups: [{id: '1'}],
                  entry_devices: [{id: '731'}],
                  exit_devices: [{id: '729'}],
                  time_limit: '1200',
                  alarm_actions: []
                }
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/zones/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                Zone: {
                  name: 'testmuster1',
                  zone_type: 8,
                  is_global: 1,
                  enable: 1,
                  status: 64,
                  muster: {
                    access_groups: [{id: '1'}],
                    entry_devices: [{id: '731'}],
                    exit_devices: [{id: '729'}],
                    time_limit: '1200',
                    alarm_actions: []
                  }
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("PUT", "https://{baseurl}/api/zones/{id}");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "Zone": {
                "name": "testmuster1",
                "zone_type": 8,
                "is_global": 1,
                "enable": 1,
                "status": 64,
                "muster": {
                  "access_groups": [
                    {
                      "id": "1"
                    }
                  ],
                  "entry_devices": [
                    {
                      "id": "731"
                    }
                  ],
                  "exit_devices": [
                    {
                      "id": "729"
                    }
                  ],
                  "time_limit": "1200",
                  "alarm_actions": []
                }
              }
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/zones/{id}',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                Zone: {
                  name: 'testmuster1',
                  zone_type: 8,
                  is_global: 1,
                  enable: 1,
                  status: 64,
                  muster: {
                    access_groups: [{id: '1'}],
                    entry_devices: [{id: '731'}],
                    exit_devices: [{id: '729'}],
                    time_limit: '1200',
                    alarm_actions: []
                  }
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/zones/{id}';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Zone":{"name":"testmuster1","zone_type":8,"is_global":1,"enable":1,"status":64,"muster":{"access_groups":[{"id":"1"}],"entry_devices":[{"id":"731"}],"exit_devices":[{"id":"729"}],"time_limit":"1200","alarm_actions":[]}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"Zone":{"name":"testmuster1","zone_type":8,"is_global":1,"enable":1,"status":64,"muster":{"access_groups":[{"id":"1"}],"entry_devices":[{"id":"731"}],"exit_devices":[{"id":"729"}],"time_limit":"1200","alarm_actions":[]}}}'
            };

            fetch('https://{baseurl}/api/zones/{id}', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/zones/{id}",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "Zone": {
                "name": "testmuster1",
                "zone_type": 8,
                "is_global": 1,
                "enable": 1,
                "status": 64,
                "muster": {
                  "access_groups": [
                    {
                      "id": "1"
                    }
                  ],
                  "entry_devices": [
                    {
                      "id": "731"
                    }
                  ],
                  "exit_devices": [
                    {
                      "id": "729"
                    }
                  ],
                  "time_limit": "1200",
                  "alarm_actions": []
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/zones/{id}");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/zones/{id}", payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/zones/{id}"


            payload = {"Zone": {
                    "name": "testmuster1",
                    "zone_type": 8,
                    "is_global": 1,
                    "enable": 1,
                    "status": 64,
                    "muster": {
                        "access_groups": [{"id": "1"}],
                        "entry_devices": [{"id": "731"}],
                        "exit_devices": [{"id": "729"}],
                        "time_limit": "1200",
                        "alarm_actions": []
                    }
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/zones/{id}")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/zones/{id}",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/zones/{id}');

            $request->setMethod(HTTP_METH_PUT);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"Zone":{"name":"testmuster1","zone_type":8,"is_global":1,"enable":1,"status":64,"muster":{"access_groups":[{"id":"1"}],"entry_devices":[{"id":"731"}],"exit_devices":[{"id":"729"}],"time_limit":"1200","alarm_actions":[]}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"Zone":{"name":"testmuster1","zone_type":8,"is_global":1,"enable":1,"status":64,"muster":{"access_groups":[{"id":"1"}],"entry_devices":[{"id":"731"}],"exit_devices":[{"id":"729"}],"time_limit":"1200","alarm_actions":[]}}}');


            $request->setRequestUrl('https://{baseurl}/api/zones/{id}');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/zones/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/zones/{id}")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/zones/{id}\"\n\n\tpayload := strings.NewReader(\"{\\\"Zone\\\":{\\\"name\\\":\\\"testmuster1\\\",\\\"zone_type\\\":8,\\\"is_global\\\":1,\\\"enable\\\":1,\\\"status\\\":64,\\\"muster\\\":{\\\"access_groups\\\":[{\\\"id\\\":\\\"1\\\"}],\\\"entry_devices\\\":[{\\\"id\\\":\\\"731\\\"}],\\\"exit_devices\\\":[{\\\"id\\\":\\\"729\\\"}],\\\"time_limit\\\":\\\"1200\\\",\\\"alarm_actions\\\":[]}}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/zones/{id}");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"Zone": @{ @"name": @"testmuster1",
            @"zone_type": @8, @"is_global": @1, @"enable": @1, @"status": @64,
            @"muster": @{ @"access_groups": @[ @{ @"id": @"1" } ],
            @"entry_devices": @[ @{ @"id": @"731" } ], @"exit_devices": @[ @{
            @"id": @"729" } ], @"time_limit": @"1200", @"alarm_actions": @[  ] }
            } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/zones/{id}"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["Zone": [
                "name": "testmuster1",
                "zone_type": 8,
                "is_global": 1,
                "enable": 1,
                "status": 64,
                "muster": [
                  "access_groups": [["id": "1"]],
                  "entry_devices": [["id": "731"]],
                  "exit_devices": [["id": "729"]],
                  "time_limit": "1200",
                  "alarm_actions": []
                ]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/zones/{id}")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/zones/{id}");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/zones/{id}"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/zones/{id}' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"Zone":{"name":"testmuster1","zone_type":8,"is_global":1,"enable":1,"status":64,"muster":{"access_groups":[{"id":"1"}],"entry_devices":[{"id":"731"}],"exit_devices":[{"id":"729"}],"time_limit":"1200","alarm_actions":[]}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/zones/{id}' -Method PUT -Headers $headers
            -ContentType 'application/json' -Body
            '{"Zone":{"name":"testmuster1","zone_type":8,"is_global":1,"enable":1,"status":64,"muster":{"access_groups":[{"id":"1"}],"entry_devices":[{"id":"731"}],"exit_devices":[{"id":"729"}],"time_limit":"1200","alarm_actions":[]}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/zones/{id}"


            payload <-
            "{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/zones/{id}" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}"
            in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"Zone\":{\"name\":\"testmuster1\",\"zone_type\":8,\"is_global\":1,\"enable\":1,\"status\":64,\"muster\":{\"access_groups\":[{\"id\":\"1\"}],\"entry_devices\":[{\"id\":\"731\"}],\"exit_devices\":[{\"id\":\"729\"}],\"time_limit\":\"1200\",\"alarm_actions\":[]}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/zones/{id}")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Zones
      summary: 'Zones: Delete'
      operationId: deleteZones
      description: This API is used to delete a Zone.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the zone which will be deleted.
          example: 32786
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url https://{baseurl}/api/zones/32786 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE https://{baseurl}/api/zones/32786 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/zones/32786
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/zones/32786",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/zones/32786',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("DELETE", "https://{baseurl}/api/zones/32786");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/zones/32786',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/zones/32786';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/zones/32786', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/zones/32786",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://{baseurl}/api/zones/32786");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("DELETE", "{baseurl}/api/zones/32786", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/zones/32786"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("DELETE", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/zones/32786")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/zones/32786",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/zones/32786');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/zones/32786');
            $request->setRequestMethod('DELETE');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/zones/32786")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/zones/32786")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/zones/32786\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/zones/32786");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/zones/32786"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/zones/32786")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/zones/32786");
            var request = new RestRequest(Method.DELETE);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/zones/32786"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/zones/32786' -Method DELETE -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/zones/32786' -Method DELETE -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/zones/32786"


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/zones/32786" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/zones/32786")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Zones
      summary: View a Zone Detail
      operationId: viewZoneDetail
      description: This API is used to view a zone detailed information.
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the zone which will be viewed.
          example: 32787
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/zones/32787 \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/zones/32787 \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/zones/32787
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/zones/32787",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/zones/32787',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("GET", "https://{baseurl}/api/zones/32787");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/zones/32787',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/zones/32787';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/zones/32787', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/zones/32787",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/zones/32787");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("")

            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }

            conn.request("GET", "{baseurl}/api/zones/32787", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/zones/32787"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/zones/32787")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/zones/32787",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/zones/32787');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/zones/32787');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/zones/32787")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/zones/32787")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/zones/32787\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/zones/32787");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/zones/32787"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/zones/32787")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: |-
            var client = new RestClient("https://{baseurl}/api/zones/32787");
            var request = new RestRequest(Method.GET);
            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");
            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/zones/32787"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/zones/32787' -Method GET -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/zones/32787' -Method GET -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/zones/32787"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/zones/32787" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/zones/32787")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/virtual_devices:
    post:
      tags:
        - Virtual Device & Event Import
      summary: Create a New Virtual Device
      operationId: createVirtualDevices
      description: >-
        Registers a **virtual device** within BioStar X.


        Each virtual device:


        - Must have a unique `id` (range: 100001–999999).
            
        - Cannot duplicate existing device IDs or names.
            
        - Appears in device lists when `?virtual=true` is included in search
        queries.


        **Notes:**


        - Virtual devices are **non-functional** placeholders (cannot control
        doors or perform access).
            
        - Once created, the **device ID cannot be modified**.
            
        - Virtual devices can be listed using `GET
        /api/v2/devices/search?virtual=true`.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - VirtualDevice
              properties:
                VirtualDevice:
                  $ref: '#/components/schemas/VirtualDeviceInput'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualDeviceResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
              example:
                Response:
                  code: '331791'
                  link: https://support.supremainc.com/en/support/home
                  message: License is required.
                  by: web
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/v2/virtual_devices \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"VirtualDevice":{"id":100001,"name":"Virtual Device 100001","description":"Virtual device for mobile punch import","device_group_id":{"id":1}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo '{"VirtualDevice":{"id":100001,"name":"Virtual Device
            100001","description":"Virtual device for mobile punch
            import","device_group_id":{"id":1}}}' |  \
              http POST https://{baseurl}/api/v2/virtual_devices \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"VirtualDevice":{"id":100001,"name":"Virtual Device 100001","description":"Virtual device for mobile punch import","device_group_id":{"id":1}}}' \
              --output-document \
              - https://{baseurl}/api/v2/virtual_devices
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/virtual_devices",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              VirtualDevice: {
                id: 100001,
                name: 'Virtual Device 100001',
                description: 'Virtual device for mobile punch import',
                device_group_id: {id: 1}
              }
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/virtual_devices',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                VirtualDevice: {
                  id: 100001,
                  name: 'Virtual Device 100001',
                  description: 'Virtual device for mobile punch import',
                  device_group_id: {id: 1}
                }
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("POST",
            "https://{baseurl}/api/v2/virtual_devices");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "VirtualDevice": {
                "id": 100001,
                "name": "Virtual Device 100001",
                "description": "Virtual device for mobile punch import",
                "device_group_id": {
                  "id": 1
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/v2/virtual_devices',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                VirtualDevice: {
                  id: 100001,
                  name: 'Virtual Device 100001',
                  description: 'Virtual device for mobile punch import',
                  device_group_id: {id: 1}
                }
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/virtual_devices';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"VirtualDevice":{"id":100001,"name":"Virtual Device 100001","description":"Virtual device for mobile punch import","device_group_id":{"id":1}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"VirtualDevice":{"id":100001,"name":"Virtual Device 100001","description":"Virtual device for mobile punch import","device_group_id":{"id":1}}}'
            };

            fetch('https://{baseurl}/api/v2/virtual_devices', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/virtual_devices",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual Device 100001\",\"description\":\"Virtual device for mobile punch import\",\"device_group_id\":{\"id\":1}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "VirtualDevice": {
                "id": 100001,
                "name": "Virtual Device 100001",
                "description": "Virtual device for mobile punch import",
                "device_group_id": {
                  "id": 1
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/v2/virtual_devices");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual
            Device 100001\",\"description\":\"Virtual device for mobile punch
            import\",\"device_group_id\":{\"id\":1}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/v2/virtual_devices", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/virtual_devices"


            payload = {"VirtualDevice": {
                    "id": 100001,
                    "name": "Virtual Device 100001",
                    "description": "Virtual device for mobile punch import",
                    "device_group_id": {"id": 1}
                }}
            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/virtual_devices")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body = "{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual
            Device 100001\",\"description\":\"Virtual device for mobile punch
            import\",\"device_group_id\":{\"id\":1}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/virtual_devices",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual Device 100001\",\"description\":\"Virtual device for mobile punch import\",\"device_group_id\":{\"id\":1}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/v2/virtual_devices');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"VirtualDevice":{"id":100001,"name":"Virtual
            Device 100001","description":"Virtual device for mobile punch
            import","device_group_id":{"id":1}}}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"VirtualDevice":{"id":100001,"name":"Virtual Device
            100001","description":"Virtual device for mobile punch
            import","device_group_id":{"id":1}}}');


            $request->setRequestUrl('https://{baseurl}/api/v2/virtual_devices');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual Device
            100001\",\"description\":\"Virtual device for mobile punch
            import\",\"device_group_id\":{\"id\":1}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/virtual_devices")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/v2/virtual_devices")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual Device 100001\",\"description\":\"Virtual device for mobile punch import\",\"device_group_id\":{\"id\":1}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/virtual_devices\"\n\n\tpayload := strings.NewReader(\"{\\\"VirtualDevice\\\":{\\\"id\\\":100001,\\\"name\\\":\\\"Virtual Device 100001\\\",\\\"description\\\":\\\"Virtual device for mobile punch import\\\",\\\"device_group_id\\\":{\\\"id\\\":1}}}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/virtual_devices");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual Device
            100001\",\"description\":\"Virtual device for mobile punch
            import\",\"device_group_id\":{\"id\":1}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"VirtualDevice": @{ @"id": @100001,
            @"name": @"Virtual Device 100001", @"description": @"Virtual device
            for mobile punch import", @"device_group_id": @{ @"id": @1 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/virtual_devices"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["VirtualDevice": [
                "id": 100001,
                "name": "Virtual Device 100001",
                "description": "Virtual device for mobile punch import",
                "device_group_id": ["id": 1]
              ]] as [String : Any]

            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/virtual_devices")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/virtual_devices");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual Device
            100001\",\"description\":\"Virtual device for mobile punch
            import\",\"device_group_id\":{\"id\":1}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/v2/virtual_devices"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual Device 100001\",\"description\":\"Virtual device for mobile punch import\",\"device_group_id\":{\"id\":1}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/virtual_devices' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"VirtualDevice":{"id":100001,"name":"Virtual Device
            100001","description":"Virtual device for mobile punch
            import","device_group_id":{"id":1}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/virtual_devices' -Method POST -Headers
            $headers -ContentType 'application/json' -Body
            '{"VirtualDevice":{"id":100001,"name":"Virtual Device
            100001","description":"Virtual device for mobile punch
            import","device_group_id":{"id":1}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/virtual_devices"


            payload <- "{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual
            Device 100001\",\"description\":\"Virtual device for mobile punch
            import\",\"device_group_id\":{\"id\":1}}}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/virtual_devices"
            in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual Device
            100001\",\"description\":\"Virtual device for mobile punch
            import\",\"device_group_id\":{\"id\":1}}}" in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"VirtualDevice\":{\"id\":100001,\"name\":\"Virtual Device
            100001\",\"description\":\"Virtual device for mobile punch
            import\",\"device_group_id\":{\"id\":1}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/virtual_devices")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
    get:
      tags:
        - Virtual Device & Event Import
      summary: Fetch Registered Virtual Devices
      operationId: fetchRegisteredVirtualDevices
      description: Retrieve a list of registered virtual devices.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualDeviceResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request GET \
              --url https://{baseurl}/api/v2/virtual_devices \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http GET https://{baseurl}/api/v2/virtual_devices \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method GET \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - https://{baseurl}/api/v2/virtual_devices
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/virtual_devices",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/virtual_devices',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("GET",
            "https://{baseurl}/api/v2/virtual_devices");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'GET',
              url: 'https://{baseurl}/api/v2/virtual_devices',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/virtual_devices';


            let options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'GET', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/virtual_devices', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/virtual_devices",
              "method": "GET",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://{baseurl}/api/v2/virtual_devices");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("GET", "{baseurl}/api/v2/virtual_devices",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: |-
            import requests

            url = "https://{baseurl}/api/v2/virtual_devices"

            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}

            response = requests.request("GET", url, headers=headers)

            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/virtual_devices")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Get.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/virtual_devices",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/virtual_devices');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/v2/virtual_devices');
            $request->setRequestMethod('GET');
            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/virtual_devices")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://{baseurl}/api/v2/virtual_devices")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/virtual_devices\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/virtual_devices");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/virtual_devices"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"GET"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/virtual_devices")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "GET"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/virtual_devices");

            var request = new RestRequest(Method.GET);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Get,
                RequestUri = new Uri("https://{baseurl}/api/v2/virtual_devices"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/virtual_devices' -Method GET -Headers
            $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/virtual_devices' -Method GET -Headers
            $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/virtual_devices"


            response <- VERB("GET", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/v2/virtual_devices"
            in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `GET uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/virtual_devices")
              .get()
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
    delete:
      tags:
        - Virtual Device & Event Import
      summary: Delete Virtual Device
      operationId: deleteVirtualDevices
      description: Deletes one or more virtual devices based on provided IDs.
      parameters:
        - name: id
          in: query
          schema:
            type: integer
            description: >-
              ID of the Virtual Devices which will be deleted. Use plus symbol
              (+) to delimit multiple IDs (e.g. 10001+10002)
            example: 100002
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
              examples:
                success:
                  summary: Successful Response
                  value:
                    Response:
                      code: '0'
                      link: https://support.supremainc.com/en/support/home
                      message: Devices deleted successfully
                      by: web
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request DELETE \
              --url 'https://{baseurl}/api/v2/virtual_devices?id=100002' \
              --header 'bs-session-id: REPLACE_KEY_VALUE'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            http DELETE 'https://{baseurl}/api/v2/virtual_devices?id=100002' \
              bs-session-id:REPLACE_KEY_VALUE
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method DELETE \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --output-document \
              - 'https://{baseurl}/api/v2/virtual_devices?id=100002'
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/virtual_devices?id=100002",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/v2/virtual_devices',
              qs: {id: '100002'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("DELETE",
            "https://{baseurl}/api/v2/virtual_devices");


            req.query({
              "id": "100002"
            });


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE"
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'DELETE',
              url: 'https://{baseurl}/api/v2/virtual_devices',
              params: {id: '100002'},
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE'}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: >-
            const fetch = require('node-fetch');


            let url = 'https://{baseurl}/api/v2/virtual_devices?id=100002';


            let options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: >-
            const options = {method: 'DELETE', headers: {'bs-session-id':
            'REPLACE_KEY_VALUE'}};


            fetch('https://{baseurl}/api/v2/virtual_devices?id=100002', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/virtual_devices?id=100002",
              "method": "DELETE",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE"
              }
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: >-
            const data = null;


            const xhr = new XMLHttpRequest();

            xhr.withCredentials = true;


            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });


            xhr.open("DELETE",
            "https://{baseurl}/api/v2/virtual_devices?id=100002");

            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");


            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            headers = { 'bs-session-id': "REPLACE_KEY_VALUE" }


            conn.request("DELETE", "{baseurl}/api/v2/virtual_devices?id=100002",
            headers=headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/virtual_devices"


            querystring = {"id":"100002"}


            headers = {"bs-session-id": "REPLACE_KEY_VALUE"}


            response = requests.request("DELETE", url, headers=headers,
            params=querystring)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: |-
            require 'uri'
            require 'net/http'
            require 'openssl'

            url = URI("https://{baseurl}/api/v2/virtual_devices?id=100002")

            http = Net::HTTP.new(url.host, url.port)
            http.use_ssl = true
            http.verify_mode = OpenSSL::SSL::VERIFY_NONE

            request = Net::HTTP::Delete.new(url)
            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            response = http.request(request)
            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/virtual_devices?id=100002",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "DELETE",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/virtual_devices');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setQueryData([
              'id' => '100002'
            ]);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: |-
            <?php

            $client = new http\Client;
            $request = new http\Client\Request;

            $request->setRequestUrl('https://{baseurl}/api/v2/virtual_devices');
            $request->setRequestMethod('DELETE');
            $request->setQuery(new http\QueryString([
              'id' => '100002'
            ]));

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE'
            ]);

            $client->enqueue($request)->send();
            $response = $client->getResponse();

            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: |-
            OkHttpClient client = new OkHttpClient();

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/virtual_devices?id=100002")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.delete("https://{baseurl}/api/v2/virtual_devices?id=100002")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/virtual_devices?id=100002\"\n\n\treq, _ := http.NewRequest(\"DELETE\", url, nil)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/virtual_devices?id=100002");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE" };


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/virtual_devices?id=100002"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"DELETE"];

            [request setAllHTTPHeaderFields:headers];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = ["bs-session-id": "REPLACE_KEY_VALUE"]


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/virtual_devices?id=100002")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "DELETE"

            request.allHTTPHeaderFields = headers


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/virtual_devices?id=100002");

            var request = new RestRequest(Method.DELETE);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Delete,
                RequestUri = new Uri("https://{baseurl}/api/v2/virtual_devices?id=100002"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/virtual_devices?id=100002' -Method DELETE
            -Headers $headers
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/virtual_devices?id=100002' -Method DELETE
            -Headers $headers
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/virtual_devices"


            queryString <- list([ 'id' ] = "100002")


            response <- VERB("DELETE", url, add_headers(bs_session-id =
            'REPLACE_KEY_VALUE'), query = queryString,
            content_type("application/octet-stream"))


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/virtual_devices?id=100002" in

            let headers = Header.add (Header.init ()) "bs-session-id"
            "REPLACE_KEY_VALUE" in


            Client.call ~headers `DELETE uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: |-
            val client = OkHttpClient()

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/virtual_devices?id=100002")
              .delete(null)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .build()

            val response = client.newCall(request).execute()
  /api/v2/virtual_devices/{id}:
    put:
      tags:
        - Virtual Device & Event Import
      summary: Modify Existing Virtual Device
      operationId: modifyExistingVirtualDevice
      description: >-
        Modify existing virtual device details. Only updatable fields need to be
        included.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                VirtualDevice:
                  device_group_id:
                    id: 1
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
          description: ID of the Virtual Device which will be modified.
          example: 100001
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualDeviceResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request PUT \
              --url https://{baseurl}/api/v2/virtual_devices/100001 \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"VirtualDevice":{"device_group_id":{"id":1}}}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: |-
            echo '{"VirtualDevice":{"device_group_id":{"id":1}}}' |  \
              http PUT https://{baseurl}/api/v2/virtual_devices/100001 \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method PUT \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"VirtualDevice":{"device_group_id":{"id":1}}}' \
              --output-document \
              - https://{baseurl}/api/v2/virtual_devices/100001
        - lang: node_native
          label: Node + Native
          source: >-
            const http = require("https");


            const options = {
              "method": "PUT",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/v2/virtual_devices/100001",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };


            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });


            req.write(JSON.stringify({VirtualDevice: {device_group_id: {id:
            1}}}));

            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/virtual_devices/100001',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {VirtualDevice: {device_group_id: {id: 1}}},
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: >
            const unirest = require("unirest");


            const req = unirest("PUT",
            "https://{baseurl}/api/v2/virtual_devices/100001");


            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });


            req.type("json");

            req.send({
              "VirtualDevice": {
                "device_group_id": {
                  "id": 1
                }
              }
            });


            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'PUT',
              url: 'https://{baseurl}/api/v2/virtual_devices/100001',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {VirtualDevice: {device_group_id: {id: 1}}}
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/v2/virtual_devices/100001';

            let options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"VirtualDevice":{"device_group_id":{"id":1}}}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'PUT',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"VirtualDevice":{"device_group_id":{"id":1}}}'
            };

            fetch('https://{baseurl}/api/v2/virtual_devices/100001', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/v2/virtual_devices/100001",
              "method": "PUT",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "VirtualDevice": {
                "device_group_id": {
                  "id": 1
                }
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("PUT", "https://{baseurl}/api/v2/virtual_devices/100001");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload = "{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("PUT", "{baseurl}/api/v2/virtual_devices/100001",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/v2/virtual_devices/100001"


            payload = {"VirtualDevice": {"device_group_id": {"id": 1}}}

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("PUT", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/v2/virtual_devices/100001")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Put.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/v2/virtual_devices/100001",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "PUT",
              CURLOPT_POSTFIELDS => "{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://{baseurl}/api/v2/virtual_devices/100001');
            $request->setMethod(HTTP_METH_PUT);

            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"VirtualDevice":{"device_group_id":{"id":1}}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"VirtualDevice":{"device_group_id":{"id":1}}}');


            $request->setRequestUrl('https://{baseurl}/api/v2/virtual_devices/100001');

            $request->setRequestMethod('PUT');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/v2/virtual_devices/100001")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.put("https://{baseurl}/api/v2/virtual_devices/100001")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/v2/virtual_devices/100001\"\n\n\tpayload := strings.NewReader(\"{\\\"VirtualDevice\\\":{\\\"device_group_id\\\":{\\\"id\\\":1}}}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/v2/virtual_devices/100001");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"VirtualDevice": @{
            @"device_group_id": @{ @"id": @1 } } };


            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/v2/virtual_devices/100001"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"PUT"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = ["VirtualDevice": ["device_group_id": ["id": 1]]]
            as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/v2/virtual_devices/100001")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "PUT"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new
            RestClient("https://{baseurl}/api/v2/virtual_devices/100001");

            var request = new RestRequest(Method.PUT);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Put,
                RequestUri = new Uri("https://{baseurl}/api/v2/virtual_devices/100001"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/v2/virtual_devices/100001' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"VirtualDevice":{"device_group_id":{"id":1}}}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/v2/virtual_devices/100001' -Method PUT
            -Headers $headers -ContentType 'application/json' -Body
            '{"VirtualDevice":{"device_group_id":{"id":1}}}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/v2/virtual_devices/100001"


            payload <- "{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}"


            encode <- "json"


            response <- VERB("PUT", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string
            "https://{baseurl}/api/v2/virtual_devices/100001" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}" in


            Client.call ~headers ~body `PUT uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"VirtualDevice\":{\"device_group_id\":{\"id\":1}}}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/v2/virtual_devices/100001")
              .put(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
  /api/events/import:
    post:
      tags:
        - Virtual Device & Event Import
      summary: Import Events
      operationId: importEvents
      description: >-
        Imports external access events into the system.


        Allows batch import of **Access Granted (4088)** and **Access Denied
        (6400)** events generated by a **Virtual Device**.


        This is typically used when an external app generates punch logs (e.g.,
        mobile attendance).


        Each imported event is stored as a normal BioStar X event, visible in
        event logs and reports.


        **Important Rules**


        - `packet_device_id` and every `events[].dev_id` must match.
            
        - Only **virtual devices** are allowed.
            
        - Only **event codes 4088 or 6400** are permitted.
            
        - `datetime` must be in **UTC** (convert local time accordingly).
            
        - All `user_id`s must exist in the system.
            
        - Each imported event will be logged individually (one row per event).
      requestBody:
        required: true
        description: Event import data containing device information and events array
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventImportInput'
            example:
              packet_device_id: 100001
              is_virtual_device: true
              events:
                - dev_id: 100001
                  evt: 6400
                  datetime: '2025-10-30T15:12:00Z'
                  user_id: '2'
                  tna_key: '1'
                - dev_id: 100001
                  evt: 6400
                  datetime: '2025-10-30T15:13:01Z'
                  user_id: '2'
                  tna_key: '1'
      responses:
        '200':
          description: Events imported successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      x-codeSamples:
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://{baseurl}/api/events/import \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --data '{"packet_device_id":100001,"is_virtual_device":true,"events":[{"dev_id":100001,"evt":6400,"datetime":"2025-10-30T15:12:00Z","user_id":"2","tna_key":"1"}]}'
        - lang: shell_httpie
          label: Shell + Httpie
          source: >-
            echo
            '{"packet_device_id":100001,"is_virtual_device":true,"events":[{"dev_id":100001,"evt":6400,"datetime":"2025-10-30T15:12:00Z","user_id":"2","tna_key":"1"}]}'
            |  \
              http POST https://{baseurl}/api/events/import \
              bs-session-id:REPLACE_KEY_VALUE \
              content-type:application/json
        - lang: shell_wget
          label: Shell + Wget
          source: |-
            wget --quiet \
              --method POST \
              --header 'bs-session-id: REPLACE_KEY_VALUE' \
              --header 'content-type: application/json' \
              --body-data '{"packet_device_id":100001,"is_virtual_device":true,"events":[{"dev_id":100001,"evt":6400,"datetime":"2025-10-30T15:12:00Z","user_id":"2","tna_key":"1"}]}' \
              --output-document \
              - https://{baseurl}/api/events/import
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "",
              "port": null,
              "path": "{baseurl}/api/events/import",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              packet_device_id: 100001,
              is_virtual_device: true,
              events: [
                {
                  dev_id: 100001,
                  evt: 6400,
                  datetime: '2025-10-30T15:12:00Z',
                  user_id: '2',
                  tna_key: '1'
                }
              ]
            }));
            req.end();
        - lang: node_request
          label: Node + Request
          source: |
            const request = require('request');

            const options = {
              method: 'POST',
              url: 'https://{baseurl}/api/events/import',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: {
                packet_device_id: 100001,
                is_virtual_device: true,
                events: [
                  {
                    dev_id: 100001,
                    evt: 6400,
                    datetime: '2025-10-30T15:12:00Z',
                    user_id: '2',
                    tna_key: '1'
                  }
                ]
              },
              json: true
            };

            request(options, function (error, response, body) {
              if (error) throw new Error(error);

              console.log(body);
            });
        - lang: node_unirest
          label: Node + Unirest
          source: |
            const unirest = require("unirest");

            const req = unirest("POST", "https://{baseurl}/api/events/import");

            req.headers({
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            });

            req.type("json");
            req.send({
              "packet_device_id": 100001,
              "is_virtual_device": true,
              "events": [
                {
                  "dev_id": 100001,
                  "evt": 6400,
                  "datetime": "2025-10-30T15:12:00Z",
                  "user_id": "2",
                  "tna_key": "1"
                }
              ]
            });

            req.end(function (res) {
              if (res.error) throw new Error(res.error);

              console.log(res.body);
            });
        - lang: node_axios
          label: Node + Axios
          source: |-
            var axios = require("axios").default;

            var options = {
              method: 'POST',
              url: 'https://{baseurl}/api/events/import',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              data: {
                packet_device_id: 100001,
                is_virtual_device: true,
                events: [
                  {
                    dev_id: 100001,
                    evt: 6400,
                    datetime: '2025-10-30T15:12:00Z',
                    user_id: '2',
                    tna_key: '1'
                  }
                ]
              }
            };

            axios.request(options).then(function (response) {
              console.log(response.data);
            }).catch(function (error) {
              console.error(error);
            });
        - lang: node_fetch
          label: Node + Fetch
          source: |-
            const fetch = require('node-fetch');

            let url = 'https://{baseurl}/api/events/import';

            let options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"packet_device_id":100001,"is_virtual_device":true,"events":[{"dev_id":100001,"evt":6400,"datetime":"2025-10-30T15:12:00Z","user_id":"2","tna_key":"1"}]}'
            };

            fetch(url, options)
              .then(res => res.json())
              .then(json => console.log(json))
              .catch(err => console.error('error:' + err));
        - lang: javascript_fetch
          label: Javascript + Fetch
          source: |-
            const options = {
              method: 'POST',
              headers: {'bs-session-id': 'REPLACE_KEY_VALUE', 'content-type': 'application/json'},
              body: '{"packet_device_id":100001,"is_virtual_device":true,"events":[{"dev_id":100001,"evt":6400,"datetime":"2025-10-30T15:12:00Z","user_id":"2","tna_key":"1"}]}'
            };

            fetch('https://{baseurl}/api/events/import', options)
              .then(response => response.json())
              .then(response => console.log(response))
              .catch(err => console.error(err));
        - lang: javascript_jquery
          label: Javascript + Jquery
          source: |-
            const settings = {
              "async": true,
              "crossDomain": true,
              "url": "https://{baseurl}/api/events/import",
              "method": "POST",
              "headers": {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
              },
              "processData": false,
              "data": "{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}"
            };

            $.ajax(settings).done(function (response) {
              console.log(response);
            });
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = JSON.stringify({
              "packet_device_id": 100001,
              "is_virtual_device": true,
              "events": [
                {
                  "dev_id": 100001,
                  "evt": 6400,
                  "datetime": "2025-10-30T15:12:00Z",
                  "user_id": "2",
                  "tna_key": "1"
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://{baseurl}/api/events/import");
            xhr.setRequestHeader("bs-session-id", "REPLACE_KEY_VALUE");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: python_python3
          label: Python + Python3
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("")


            payload =
            "{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}"


            headers = {
                'bs-session-id': "REPLACE_KEY_VALUE",
                'content-type': "application/json"
                }

            conn.request("POST", "{baseurl}/api/events/import", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
        - lang: python_requests
          label: Python + Requests
          source: >-
            import requests


            url = "https://{baseurl}/api/events/import"


            payload = {
                "packet_device_id": 100001,
                "is_virtual_device": True,
                "events": [
                    {
                        "dev_id": 100001,
                        "evt": 6400,
                        "datetime": "2025-10-30T15:12:00Z",
                        "user_id": "2",
                        "tna_key": "1"
                    }
                ]
            }

            headers = {
                "bs-session-id": "REPLACE_KEY_VALUE",
                "content-type": "application/json"
            }


            response = requests.request("POST", url, json=payload,
            headers=headers)


            print(response.text)
        - lang: ruby_native
          label: Ruby + Native
          source: >-
            require 'uri'

            require 'net/http'

            require 'openssl'


            url = URI("https://{baseurl}/api/events/import")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true

            http.verify_mode = OpenSSL::SSL::VERIFY_NONE


            request = Net::HTTP::Post.new(url)

            request["bs-session-id"] = 'REPLACE_KEY_VALUE'

            request["content-type"] = 'application/json'

            request.body =
            "{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}"


            response = http.request(request)

            puts response.read_body
        - lang: php_curl
          label: Php + Curl
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://{baseurl}/api/events/import",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "POST",
              CURLOPT_POSTFIELDS => "{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}",
              CURLOPT_HTTPHEADER => [
                "bs-session-id: REPLACE_KEY_VALUE",
                "content-type: application/json"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: php_http1
          label: Php + Http1
          source: >-
            <?php


            $request = new HttpRequest();

            $request->setUrl('https://{baseurl}/api/events/import');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $request->setBody('{"packet_device_id":100001,"is_virtual_device":true,"events":[{"dev_id":100001,"evt":6400,"datetime":"2025-10-30T15:12:00Z","user_id":"2","tna_key":"1"}]}');


            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: php_http2
          label: Php + Http2
          source: >-
            <?php


            $client = new http\Client;

            $request = new http\Client\Request;


            $body = new http\Message\Body;

            $body->append('{"packet_device_id":100001,"is_virtual_device":true,"events":[{"dev_id":100001,"evt":6400,"datetime":"2025-10-30T15:12:00Z","user_id":"2","tna_key":"1"}]}');


            $request->setRequestUrl('https://{baseurl}/api/events/import');

            $request->setRequestMethod('POST');

            $request->setBody($body);


            $request->setHeaders([
              'bs-session-id' => 'REPLACE_KEY_VALUE',
              'content-type' => 'application/json'
            ]);


            $client->enqueue($request)->send();

            $response = $client->getResponse();


            echo $response->getBody();
        - lang: java_okhttp
          label: Java + Okhttp
          source: >-
            OkHttpClient client = new OkHttpClient();


            MediaType mediaType = MediaType.parse("application/json");

            RequestBody body = RequestBody.create(mediaType,
            "{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}");

            Request request = new Request.Builder()
              .url("https://{baseurl}/api/events/import")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build();

            Response response = client.newCall(request).execute();
        - lang: java_unirest
          label: Java + Unirest
          source: >-
            HttpResponse<String> response =
            Unirest.post("https://{baseurl}/api/events/import")
              .header("bs-session-id", "REPLACE_KEY_VALUE")
              .header("content-type", "application/json")
              .body("{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}")
              .asString();
        - lang: go_native
          label: Go + Native
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://{baseurl}/api/events/import\"\n\n\tpayload := strings.NewReader(\"{\\\"packet_device_id\\\":100001,\\\"is_virtual_device\\\":true,\\\"events\\\":[{\\\"dev_id\\\":100001,\\\"evt\\\":6400,\\\"datetime\\\":\\\"2025-10-30T15:12:00Z\\\",\\\"user_id\\\":\\\"2\\\",\\\"tna_key\\\":\\\"1\\\"}]}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"bs-session-id\", \"REPLACE_KEY_VALUE\")\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}"
        - lang: c_libcurl
          label: C + Libcurl
          source: >-
            CURL *hnd = curl_easy_init();


            curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");

            curl_easy_setopt(hnd, CURLOPT_URL,
            "https://{baseurl}/api/events/import");


            struct curl_slist *headers = NULL;

            headers = curl_slist_append(headers, "bs-session-id:
            REPLACE_KEY_VALUE");

            headers = curl_slist_append(headers, "content-type:
            application/json");

            curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);


            curl_easy_setopt(hnd, CURLOPT_POSTFIELDS,
            "{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}");


            CURLcode ret = curl_easy_perform(hnd);
        - lang: objc_nsurlsession
          label: Objc + Nsurlsession
          source: >-
            #import <Foundation/Foundation.h>


            NSDictionary *headers = @{ @"bs-session-id": @"REPLACE_KEY_VALUE",
                                       @"content-type": @"application/json" };
            NSDictionary *parameters = @{ @"packet_device_id": @100001,
                                          @"is_virtual_device": @YES,
                                          @"events": @[ @{ @"dev_id": @100001, @"evt": @6400, @"datetime": @"2025-10-30T15:12:00Z", @"user_id": @"2", @"tna_key": @"1" } ] };

            NSData *postData = [NSJSONSerialization
            dataWithJSONObject:parameters options:0 error:nil];


            NSMutableURLRequest *request = [NSMutableURLRequest
            requestWithURL:[NSURL
            URLWithString:@"https://{baseurl}/api/events/import"]
                                                                   cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                               timeoutInterval:10.0];
            [request setHTTPMethod:@"POST"];

            [request setAllHTTPHeaderFields:headers];

            [request setHTTPBody:postData];


            NSURLSession *session = [NSURLSession sharedSession];

            NSURLSessionDataTask *dataTask = [session
            dataTaskWithRequest:request
                                                        completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                            if (error) {
                                                                NSLog(@"%@", error);
                                                            } else {
                                                                NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                                NSLog(@"%@", httpResponse);
                                                            }
                                                        }];
            [dataTask resume];
        - lang: swift_nsurlsession
          label: Swift + Nsurlsession
          source: >-
            import Foundation


            let headers = [
              "bs-session-id": "REPLACE_KEY_VALUE",
              "content-type": "application/json"
            ]

            let parameters = [
              "packet_device_id": 100001,
              "is_virtual_device": true,
              "events": [
                [
                  "dev_id": 100001,
                  "evt": 6400,
                  "datetime": "2025-10-30T15:12:00Z",
                  "user_id": "2",
                  "tna_key": "1"
                ]
              ]
            ] as [String : Any]


            let postData = JSONSerialization.data(withJSONObject: parameters,
            options: [])


            let request = NSMutableURLRequest(url: NSURL(string:
            "https://{baseurl}/api/events/import")! as URL,
                                                    cachePolicy: .useProtocolCachePolicy,
                                                timeoutInterval: 10.0)
            request.httpMethod = "POST"

            request.allHTTPHeaderFields = headers

            request.httpBody = postData as Data


            let session = URLSession.shared

            let dataTask = session.dataTask(with: request as URLRequest,
            completionHandler: { (data, response, error) -> Void in
              if (error != nil) {
                print(error)
              } else {
                let httpResponse = response as? HTTPURLResponse
                print(httpResponse)
              }
            })


            dataTask.resume()
        - lang: csharp_restsharp
          label: Csharp + Restsharp
          source: >-
            var client = new RestClient("https://{baseurl}/api/events/import");

            var request = new RestRequest(Method.POST);

            request.AddHeader("bs-session-id", "REPLACE_KEY_VALUE");

            request.AddHeader("content-type", "application/json");

            request.AddParameter("application/json",
            "{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}",
            ParameterType.RequestBody);

            IRestResponse response = client.Execute(request);
        - lang: csharp_httpclient
          label: Csharp + Httpclient
          source: |-
            var client = new HttpClient();
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                RequestUri = new Uri("https://{baseurl}/api/events/import"),
                Headers =
                {
                    { "bs-session-id", "REPLACE_KEY_VALUE" },
                },
                Content = new StringContent("{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}")
                {
                    Headers =
                    {
                        ContentType = new MediaTypeHeaderValue("application/json")
                    }
                }
            };
            using (var response = await client.SendAsync(request))
            {
                response.EnsureSuccessStatusCode();
                var body = await response.Content.ReadAsStringAsync();
                Console.WriteLine(body);
            }
        - lang: powershell_webrequest
          label: Powershell + Webrequest
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-WebRequest -Uri
            'https://{baseurl}/api/events/import' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"packet_device_id":100001,"is_virtual_device":true,"events":[{"dev_id":100001,"evt":6400,"datetime":"2025-10-30T15:12:00Z","user_id":"2","tna_key":"1"}]}'
        - lang: powershell_restmethod
          label: Powershell + Restmethod
          source: >-
            $headers=@{}

            $headers.Add("bs-session-id", "REPLACE_KEY_VALUE")

            $headers.Add("content-type", "application/json")

            $response = Invoke-RestMethod -Uri
            'https://{baseurl}/api/events/import' -Method POST -Headers $headers
            -ContentType 'application/json' -Body
            '{"packet_device_id":100001,"is_virtual_device":true,"events":[{"dev_id":100001,"evt":6400,"datetime":"2025-10-30T15:12:00Z","user_id":"2","tna_key":"1"}]}'
        - lang: r_httr
          label: R + Httr
          source: >-
            library(httr)


            url <- "https://{baseurl}/api/events/import"


            payload <-
            "{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}"


            encode <- "json"


            response <- VERB("POST", url, body = payload,
            add_headers(bs_session-id = 'REPLACE_KEY_VALUE', '),
            content_type("application/json"), encode = encode)


            content(response, "text")
        - lang: ocaml_cohttp
          label: Ocaml + Cohttp
          source: >-
            open Cohttp_lwt_unix

            open Cohttp

            open Lwt


            let uri = Uri.of_string "https://{baseurl}/api/events/import" in

            let headers = Header.add_list (Header.init ()) [
              ("bs-session-id", "REPLACE_KEY_VALUE");
              ("content-type", "application/json");
            ] in

            let body = Cohttp_lwt_body.of_string
            "{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}"
            in


            Client.call ~headers ~body `POST uri

            >>= fun (res, body_stream) ->
              (* Do stuff with the result *)
        - lang: kotlin
          label: Kotlin + Okhttp
          source: >-
            val client = OkHttpClient()


            val mediaType = MediaType.parse("application/json")

            val body = RequestBody.create(mediaType,
            "{\"packet_device_id\":100001,\"is_virtual_device\":true,\"events\":[{\"dev_id\":100001,\"evt\":6400,\"datetime\":\"2025-10-30T15:12:00Z\",\"user_id\":\"2\",\"tna_key\":\"1\"}]}")

            val request = Request.Builder()
              .url("https://{baseurl}/api/events/import")
              .post(body)
              .addHeader("bs-session-id", "REPLACE_KEY_VALUE")
              .addHeader("content-type", "application/json")
              .build()

            val response = client.newCall(request).execute()
components:
  securitySchemes:
    SessionAuth:
      type: apiKey
      in: header
      name: bs-session-id
      description: BioStar X's session id. Generated on successful login.
  schemas:
    EventImportInput:
      type: object
      description: Input for importing external access events into the system
      required:
        - packet_device_id
        - is_virtual_device
        - events
      properties:
        packet_device_id:
          type: integer
          description: Must match `dev_id` of all included events.
          example: 100001
        is_virtual_device:
          type: boolean
          description: >-
            Indicates whether the device is virtual. Must be `true` for event
            imports.
          example: true
        events:
          type: array
          description: List of event objects to import.
          items:
            $ref: '#/components/schemas/ImportEventItem'
    ImportEventItem:
      type: object
      description: Individual event item for import
      required:
        - dev_id
        - evt
        - datetime
        - user_id
      properties:
        dev_id:
          type: integer
          description: Device ID - must match `packet_device_id`
          example: 100001
        evt:
          type: integer
          description: >-
            Event code - only `4088` (Access Granted) or `6400` (Access Denied)
            are allowed
          enum:
            - 4088
            - 6400
          example: 6400
        datetime:
          type: string
          format: date-time
          description: Event timestamp in UTC (ISO 8601 format)
          example: '2025-10-30T15:12:00Z'
        user_id:
          type: string
          description: User ID - must correspond to a valid user in the system
          example: '2'
        tna_key:
          type: string
          description: Optional transaction key or reference identifier
          nullable: true
          example: '1'
    VirtualDeviceInput:
      type: object
      description: Root object containing virtual device details.
      required:
        - id
        - name
        - device_group_id
      properties:
        id:
          type: integer
          description: >-
            Unique identifier for the virtual device. Must be within
            100001–999999 and not duplicate any existing device ID.
          example: 100001
        name:
          type: string
          description: >-
            Display name of the virtual device. Must be unique (no duplicate
            with existing devices).
          example: Virtual Device 100001
        description:
          type: string
          description: Optional text description for internal reference.
          example: Virtual device for mobile punch import
        device_group_id:
          type: object
          description: Defines which device group this virtual device belongs to.
          required:
            - id
          properties:
            id:
              type: integer
              description: IThe ID of an existing device group.
              example: 1
    VirtualDeviceResponse:
      type: object
      properties:
        VirtualDevices:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: Unique identifier for the virtual device.
                example: 100001
              name:
                type: string
                description: Display name of the virtual device.
                example: Virtual Device 100001
              description:
                type: string
                description: Text description for internal reference.
                example: Virtual device for mobile punch import
              device_group_id:
                type: object
                properties:
                  id:
                    type: integer
                    description: ID of the device group.
                    example: 1
        Response:
          $ref: '#/components/schemas/ApiResponse'
    InterlockZoneInput:
      type: object
      description: Input for creating interlock zone
      required:
        - Zone
      properties:
        Zone:
          type: object
          required:
            - name
            - zone_type
            - is_global
            - enable
            - inter_lock
          properties:
            name:
              type: string
              description: Enter an interlock zone name.
              minLength: 1
              maxLength: 48
              example: IN1
            description:
              type: string
              description: Enter an interlock zone description.
              maxLength: 255
              example: ''
            zone_type:
              type: integer
              description: View the zone type.
              example: 7
            is_global:
              type: integer
              description: >-
                You can check the application range of the zone. Only Local mode
                is supported for interlock zone, and the zone can be set only
                with devices connected to the CoreStation and RS-485.
              example: 0
            enable:
              type: integer
              description: You can disable the interlock zone. input `1` to enable it.
              example: 1
            inter_lock:
              type: object
              required:
                - doors
                - sensor_inputs
              properties:
                doors:
                  type: array
                  items:
                    type: object
                    required:
                      - id
                    properties:
                      id:
                        type: integer
                        description: >-
                          Select the doors to include in the interlock zone. You
                          must select at least two doors that are the door
                          sensor is connected.
                        example: 2
                sensor_inputs:
                  type: array
                  minItems: 1
                  items:
                    type: object
                    required:
                      - device
                      - input_index
                      - duration
                      - normal_open
                      - input_type
                    properties:
                      device:
                        type: object
                        required:
                          - id
                        properties:
                          id:
                            type: integer
                            description: >-
                              If a user stays in the zone, this option can
                              prevent others from entering the zone. Input the
                              device ID which will be used as sensor.
                            example: 546091003
                      input_index:
                        type: integer
                        description: Index of the sensor which will be used.
                        example: 0
                      duration:
                        type: integer
                        description: Set the duration.
                        example: 300
                      normal_open:
                        type: integer
                        description: Set status between Normally Open or Closed.
                        example: 0
                      input_type:
                        type: string
                        description: Type of the input.
                        example: input
                alarm_actions:
                  type: array
                  description: Optional alarm actions to execute when specific events occur
                  items:
                    type: object
                    required:
                      - input_event_id
                      - output_type
                      - output_device_id
                    properties:
                      input_event_id:
                        type: integer
                        description: Event ID that triggers the alarm action
                        example: 41472
                      output_type:
                        type: integer
                        description: Type of output action
                        example: 3
                      output_device_id:
                        type: object
                        description: Output device configuration
                        required:
                          - id
                        properties:
                          id:
                            type: integer
                            description: Output device ID
                            example: 546091003
                          buzzer:
                            type: boolean
                            description: Enable buzzer output
                            example: true
                      output_buzzer_volume:
                        type: integer
                        description: Buzzer volume level (1-10)
                        example: 1
    TimeZone:
      type: integer
      description: >-
        Time Zone ID for system operations. Affects timing calculations based on
        UTC offset.


        **Available Time Zones:**

        | ID | Offset | Description | ID | Offset | Description |

        |---|---|---|---|---|---|

        | 0 | -720 | UTC-12:00 | 17 | +210 | UTC+03:30 |

        | 1 | -660 | UTC-11:00 | 18 | +240 | UTC+04:00 |

        | 2 | -600 | UTC-10:00 | 19 | +270 | UTC+04:30 |

        | 3-1 | -570 | UTC-09:30 | 20 | +300 | UTC+05:00 |

        | 3 | -540 | UTC-09:00 | 21 | +330 | UTC+05:30 |

        | 4 | -480 | UTC-08:00 | 22 | +345 | UTC+05:45 |

        | 5 | -420 | UTC-07:00 | 23 | +360 | UTC+06:00 |

        | 6 | -360 | UTC-06:00 | 23+1 | +390 | UTC+06:30 |

        | 7 | -300 | UTC-05:00 | 24 | +420 | UTC+07:00 |

        | 8-1 | -270 | UTC-04:30 | 25 | +480 | UTC+08:00 |

        | 8 | -240 | UTC-04:00 | 25+1 | +510 | UTC+08:30 |

        | 9 | -210 | UTC-03:30 | 25+2 | +525 | UTC+08:45 |

        | 10 | -180 | UTC-03:00 | 26 | +540 | UTC+09:00 (Default) |

        | 11 | -120 | UTC-02:00 | 27 | +570 | UTC+09:30 |

        | 12 | -60 | UTC-01:00 | 28 | +600 | UTC+10:00 |

        | 13 | 0 | UTC±00:00 | 28+1 | +630 | UTC+10:30 |

        | 14 | +60 | UTC+01:00 | 29 | +660 | UTC+11:00 |

        | 15 | +120 | UTC+02:00 | 30 | +720 | UTC+12:00 |

        | 16 | +180 | UTC+03:00 | 30+1 | +765 | UTC+12:45 |

        | | | | 31 | +780 | UTC+13:00 |

        | | | | 32 | +840 | UTC+14:00 |
      default: 26
      example: 25
    OccupancyZoneInput:
      type: object
      description: Input for creating occupancy limit zone
      required:
        - is_enabled
        - name
        - zone_type
        - status
        - occupancy_detail
      properties:
        is_enabled:
          type: integer
          description: >-
            Deactivate the occupancy limit zone. If the zone is deactivated,
            both Count that refers to the number of users in the zone and Count
            Bypass settings will be initialized. Select Active to enable it.
            (`1`=Active, `0`=Inactive)
          enum:
            - 0
            - 1
          example: 1
        name:
          type: string
          description: >-
            Enter an occupancy limit zone name. Name can be up to 48 characters
            in length and cannot be set to the same name as other zones.
          maxLength: 48
          minLength: 1
          example: OccupancyZone1
        zone_type:
          type: integer
          description: View the zone type.
          example: 11
        status:
          type: integer
          description: Current status of the zone
          example: 0
        occupancy_detail:
          type: object
          required:
            - limit_count
            - entry_devices
            - exit_devices
            - network_fail_action
          properties:
            limit_count:
              type: integer
              description: >-
                Enter the number of users who will be restricted from entering
                the zone. If the number of users in the zone reaches the limit,
                entry will be restricted. You can enter a number from 0 to
                10,000, and if it is set to `0`, people can enter the zone
                without limit.
              example: 100
            entry_devices:
              type: array
              description: >-
                Select a device to use for entry. You can select a device from
                the list of added devices.
              items:
                type: string
              example:
                - '543720368'
            exit_devices:
              type: array
              description: >-
                Select a device to use at exit. You can select a device from the
                list of added devices.
              items:
                type: string
              example:
                - '542353521'
            almost_full_alert_setting:
              type: object
              properties:
                level:
                  type: integer
                  description: >-
                    Set an alert to an administrator or set to save event logs
                    before Count reaches the occupancy limit.
                  example: 1
                step_1:
                  type: integer
                  description: The first alert for occupancy limit.
                  example: 95
                step_2:
                  type: integer
                  description: The second alert for occupancy limit.
                  example: 0
            auto_reset_count_time:
              type: object
              properties:
                is_enabled:
                  type: integer
                  description: >-
                    Toggle to set the time to automatically reset occupancy
                    limit Count. (1=enabled, 0=disabled)
                  enum:
                    - 0
                    - 1
                  example: 1
                minute:
                  type: integer
                  description: The Count will be initialized at the time you set every day.
                  example: 1439
            network_fail_action:
              type: integer
              description: >-
                Set whether to allow users to enter or leave when a network
                error occurs in the device set in the zone. If you set it to
                Allow Entry and Exit, it stops entry restrictions when the
                device loses network connection, and people can enter the zone
                even if Count in the zone exceeds the occupancy limit.
                (0=Restrict Entry and Exit, 1=Allow Entry and Exit)
              enum:
                - 0
                - 1
              example: 0
            bypass_groups:
              type: array
              description: >-
                Set Count Bypass by selecting bypass groups to allow users in
                the group to enter the zone at any time without affecting the
                number of Count. The Bypass Count column displays the number of
                people from Count Bypass in the zone list.


                It is not able to use the Count Bypass feature when you set
                Thermal & Mask Check Mode as Check without authentication while
                using the device with a thermal camera.

                Up to 16 bypass groups can be added.
              maxItems: 16
              items:
                type: object
                required:
                  - acsgruid
                properties:
                  acsgruid:
                    type: integer
                    description: Access Group ID for count bypass
                    example: 1
    AuditSearchRequest:
      type: object
      properties:
        search:
          type: string
          description: >-
            Search term to filter with Audit Trail log. To show all which have
            Audit Trail logs, simply remove this parameter from the request.
          example: ag
        limit:
          type: integer
          description: Limit the number of response's records by the specified value.
          example: 201
        offset:
          type: integer
          description: Offset the response's records by the specified value.
          example: 0
    ExportCSV:
      type: object
      required:
        - columns
        - headers
      properties:
        conditions:
          $ref: '#/components/schemas/QueryConditions'
        offset:
          type: integer
          description: Offset the response's records by the specified value.
        columns:
          type: array
          items:
            type: string
          description: List of columns which will be included on the CSV.
        headers:
          type: array
          items:
            type: string
          description: Name of the header on the exported .csv file.
    QueryConditions:
      type: array
      description: >-
        A set of conditions to filter the response of the API. On this case,
        it's using the datetime field to filter according to the values given.
      items:
        type: object
        properties:
          column:
            type: string
            description: Column name to be used as filter.
          operator:
            type: integer
            description: Operator number to be used as filter.
          values:
            type: array
            items:
              type: string
            description: List of values to be used as filter.
    MobileAccessCardInput:
      type: object
      description: Input for creating Mobile Access Card in Airfob Portal
      required:
        - MobileCollection
      properties:
        MobileCollection:
          type: object
          required:
            - mobile
          properties:
            mobile:
              type: object
              required:
                - user_id
                - email
                - card_id
                - startTime
                - endTime
                - mobileCardType
              properties:
                user_id:
                  type: array
                  description: User ID
                  items:
                    type: string
                  example:
                    - '3'
                name:
                  type: array
                  description: User Name
                  items:
                    type: string
                    nullable: true
                  example:
                    - test2
                title:
                  type: array
                  description: User's Title
                  items:
                    type: string
                    nullable: true
                  example:
                    - null
                department:
                  type: array
                  description: Department Name
                  items:
                    type: string
                    nullable: true
                  example:
                    - null
                phone:
                  type: array
                  description: Phone Number
                  items:
                    type: string
                    nullable: true
                  example:
                    - null
                email:
                  type: array
                  description: Email address
                  items:
                    type: string
                    format: email
                  example:
                    - test2@suprema.com
                portraitData:
                  type: array
                  description: Photo encoding data in Base64 format
                  items:
                    type: string
                    nullable: true
                  example:
                    - null
                card_id:
                  type: array
                  description: Card ID
                  items:
                    type: string
                  example:
                    - '2'
                startDate:
                  type: array
                  description: >-
                    Start Date for Dynamic Site (timestamp in milliseconds,
                    required for Dynamic Site)
                  items:
                    type: integer
                    format: int64
                    nullable: true
                  example:
                    - 1703563320000
                endDate:
                  type: array
                  description: >-
                    End Date for Dynamic Site (timestamp in milliseconds,
                    required for Dynamic Site)
                  items:
                    type: integer
                    format: int64
                    nullable: true
                  example:
                    - 1703649720000
                startTime:
                  type: array
                  description: User period start date (timestamp in milliseconds, required)
                  items:
                    type: integer
                    format: int64
                  example:
                    - 978274800000
                endTime:
                  type: array
                  description: User period end date (timestamp in milliseconds, required)
                  items:
                    type: integer
                    format: int64
                  example:
                    - 1924959540000
                issueCount:
                  type: array
                  description: ToM card issue round (required for ToM)
                  items:
                    type: integer
                    nullable: true
                  example:
                    - 1
                duressMask:
                  type: array
                  description: Duress value
                  items:
                    type: string
                    nullable: true
                  example:
                    - null
                useAlphanumericID:
                  type: array
                  description: 'ID type: `0` for Numeric, `1` for Alphanumeric'
                  items:
                    type: integer
                    enum:
                      - 0
                      - 1
                    nullable: true
                  example:
                    - 0
                cardAuthModeEx:
                  type: array
                  description: >-
                    Extended card authentication mode (see mapping table in API
                    description)
                  items:
                    type: integer
                    enum:
                      - 21
                      - 22
                      - 23
                      - 24
                      - 25
                      - 26
                      - 27
                      - 28
                      - 29
                      - 30
                      - 31
                      - 32
                      - 33
                      - 34
                      - 35
                  example:
                    - 21
                pin:
                  type: array
                  description: PIN number
                  items:
                    type: string
                    nullable: true
                  example:
                    - null
                accessGroupId:
                  type: array
                  description: Access Group ID
                  items:
                    type: string
                    nullable: true
                  example:
                    - null
                mobileCardType:
                  type: array
                  description: >-
                    Mobile card type (required): `4` for CSN Mobile, `14` for
                    ToM_AoC, `15` for ToM_SCC
                  items:
                    type: string
                    enum:
                      - '4'
                      - '14'
                      - '15'
                  example:
                    - '4'
    MobileAccessCardResponse:
      type: object
      description: Response from creating Mobile Access Card
      properties:
        MobileCollection:
          type: object
          properties:
            listMobile:
              type: array
              items:
                type: object
                properties:
                  apisnddt:
                    type: string
                    format: date-time
                    description: API send time
                    example: '2023-12-26T04:03:17.382Z'
                  userid:
                    type: integer
                    description: User ID
                    example: 2
                  crdid:
                    type: integer
                    description: Card ID
                    example: 2
                  portalrslt:
                    type: string
                    description: Portal result (not used)
                    example: ''
            recordMobile:
              type: array
              items:
                type: object
                properties:
                  number:
                    type: integer
                    description: Card ID
                    example: 2
                  status:
                    type: string
                    description: Site status
                    enum:
                      - ACTIVE
                      - INACTIVE
                    example: INACTIVE
                  cardType:
                    type: string
                    description: Site type (Regular or Dynamic)
                    enum:
                      - REGULAR
                      - DYNAMIC
                    example: REGULAR
                  startDate:
                    type: string
                    description: Start Date for Dynamic Site (timestamp in milliseconds)
                    example: '0'
                  endDate:
                    type: string
                    description: End Date for Dynamic Site (timestamp in milliseconds)
                    example: '253402300799000'
                  startTime:
                    type: string
                    description: User period start date (timestamp in milliseconds)
                    example: '978274800000'
                  endTime:
                    type: string
                    description: User period end date (timestamp in milliseconds)
                    example: '1924959540000'
                  name:
                    type: string
                    description: User name
                    example: test2
                  department:
                    type: string
                    description: Department name
                    example: ''
                  title:
                    type: string
                    description: User's title
                    example: ''
                  issueCount:
                    type: integer
                    description: ToM card issue round
                    example: 1
                  cardAuthMode:
                    type: integer
                    description: Card standard AuthMode value (see ToM description in API)
                    example: 2
                  cardAuthModeEx:
                    type: integer
                    description: Card extended AuthMode value (see ToM description in API)
                    example: 21
                  mobileCardType:
                    type: integer
                    description: >-
                      Mobile card type: `4` for CSN Mobile, `14` for ToM_AoC,
                      `15` for ToM_SCC
                    enum:
                      - 4
                      - 14
                      - 15
                    example: 4
        Response:
          $ref: '#/components/schemas/ApiResponse'
    ServerMatching:
      type: object
      properties:
        use-server-matching:
          type: boolean
          description: Activates/Deactivates server matching. Toggle `true` to activate.
        matching-concurrency-count:
          type: integer
          description: Configure how many matchings can be done simultaneously.
        security-level:
          type: integer
          description: >-
            Configure the server matching’s security level for fingerprints. The
            higher the security level is set, the more the false rejection rate
            (FRR) can occur.
        fast-mode:
          type: boolean
          description: Configure the fingerprint matching speed.
          example: true
        face-security-level:
          type: integer
          description: >-
            Configure the server matching’s security level for faces. The higher
            the security level is set, the more the false rejection rate (FRR)
            can occur.
    CustomFieldCollection:
      type: object
      properties:
        rows:
          type: array
          items:
            type: object
            required:
              - order
              - name
              - type
            properties:
              order:
                type: integer
                description: Unique
              name:
                type: string
                description: Unique
              type:
                type: integer
                description: |
                  0: Text Input, 1: Number Input, 2: Combo Box, 3: File Upload.
              data:
                type: string
                description: |
                  Combo Box options, use (;) as separator of each value.
              enable:
                type: boolean
                description: Toggle `true` to enable custom field.
    Preference:
      type: object
      properties:
        Preference:
          type: object
          properties:
            language:
              type: string
              description: Preference language. Example - ko, en
              example: en
            date_format:
              type: string
              description: Format of the date
              example: yyyy/MM/dd
            time_format:
              type: string
              description: Format of the time
              example: HH:mm
            time_long_term_format:
              type: string
              description: Format for long term time
              example: HH:mm:ss
            time_zone:
              type: string
              description: |-
                Select the time zone that corresponds to your current location.

                | Time Zone | ID | Time Zone | ID |
                |-----------|----|-----------|----|
                | UTC-12:00 | 0 | UTC+03:30 | 17 |
                | UTC-11:00 | 1 | UTC+04:00 | 18 |
                | UTC-10:00 | 2 | UTC+04:30 | 19 |
                | UTC-09:30 | 3-1 | UTC+05:00 | 20 |
                | UTC-09:00 | 3 | UTC+05:30 | 21 |
                | UTC-08:00 | 4 | UTC+05:45 | 22 |
                | UTC-07:00 | 5 | UTC+06:00 | 23 |
                | UTC-06:00 | 6 | UTC+06:30 | 23+1 |
                | UTC-05:00 | 7 | UTC+07:00 | 24 |
                | UTC-04:30 | 8-1 | UTC+08:00 | 25 |
                | UTC-04:00 | 8 | UTC+08:30 | 25+1 |
                | UTC-03:30 | 9 | UTC+08:45 | 25+2 |
                | UTC-03:00 | 10 | UTC+09:00 | 26 |
                | UTC-02:00 | 11 | UTC+09:30 | 27 |
                | UTC-01:00 | 12 | UTC+10:00 | 28 |
                | UTC±00:00 | 13 | UTC+10:30 | 28+1 |
                | UTC+01:00 | 14 | UTC+11:00 | 29 |
                | UTC+02:00 | 15 | UTC+12:00 | 30 |
                | UTC+03:00 | 16 | UTC+12:45 | 30+1 |
                |  |  | UTC+13:00 | 31 |
                |  |  | UTC+14:00 | 32 |
              example: '25'
            dst1:
              type: string
              description: ID of the first Daylight Saving Time applied. 0 for none.
              example: '0'
            dst2:
              type: string
              description: ID of the second Daylight Saving Time applied. 0 for none.
              example: '0'
            depend_on_os:
              type: boolean
              example: true
            user_id:
              type: object
              properties:
                user_id:
                  type: integer
                  description: ID of the user
                  example: 6
    SMTPSettings:
      type: object
      required:
        - name
        - description
        - smtp_server_addr
        - smtp_server_port
        - smtp_username
        - smtp_password
        - smtp_security
        - smtp_sender
      properties:
        AlarmSmtp:
          type: object
          properties:
            name:
              type: string
              description: Enter the SMTP server name.
              example: smtp.example.com
            description:
              type: string
              description: Enter the description.
              example: Example SMTP Server
            smtp_server_addr:
              type: string
              description: >-
                Enter the SMTP server address. SMTP server address is the same
                form as 'smtp. Email Service Provider.com', and you can check it
                on the settings screen of email to use as an SMTP.
              example: smtp.example.com
            smtp_server_port:
              type: string
              description: >-
                Enter the port number of the SMTP server. you can check it on
                the settings screen of email to use as an SMTP
              example: '587'
            smtp_username:
              type: string
              description: Enter the user name of the SMTP server.
              example: user@example.com
            smtp_password:
              type: string
              description: Enter the password of the SMTP server.
              format: password
            smtp_security:
              type: string
              description: Select the security type of the SMTP server.
              example: '2'
            smtp_sender:
              type: string
              description: Enter the sender email address.
              example: sender@example.com
    EmailSettings:
      type: object
      description: Configuration parameters for email settings
      required:
        - title
        - company_name
        - company_logo
        - admin_contact
        - use_setting
      properties:
        title:
          type: string
          description: Enter the title of the email.
          example: VisualFace
        company_name:
          type: string
          description: Enter the company name.
          example: Suprema Inc.
        company_logo:
          type: string
          description: >-
            Supported image file formats are GIF, JPG, JPEG, JPE, JFIF, PNG. 
            <br>Supported image file size is up to 5MB. Base64 encoded string of
            the company logo image.
          example: ''
        admin_contact:
          type: string
          description: Enter the contact information of the person in charge.
          example: admin@example.com
        use_setting:
          type: boolean
          description: >-
            To use the enrollment set it as Use. If you set it as Not Use,
            BioStar X will be unable to send the visual face mobile enrollment
            link or QR to users.
          example: true
    ADServerConnect:
      type: object
      description: >-
        Configuration parameters for Active Directory connection testing and
        setup
      required:
        - serverAddress
        - userName
        - password
        - userDomainName
        - useSSL
        - adlogin
        - RedirectionUri
        - adEnable
        - adType
        - prevAdType
        - prevDomainName
        - prevServerAddr
        - resetSync
        - scheduleSyncInterval
        - syncEvtCheck
        - syncType
        - useCustomField
      properties:
        serverAddress:
          type: string
          description: IP Address of the Domain Controller
          example: ''
        userName:
          type: string
          description: User Name which will be used to connect to the Domain Controller
          example: 3323232-1111-33b6-a0a0-dfeq6bc7a762
        password:
          type: string
          description: User Name's corresponding password
          format: password
          example: asdfasdfas~!2sdfsdfasdf
        userDomainName:
          type: string
          description: BaseDN of the Domain Controller
          example: test.onmicrosoft.com
        useSSL:
          type: boolean
          description: >-
            Option to use encryption when communicating with a Windows Active
            Directory server.


            Install Active Directory Certificate Services and set the keystore
            password by referring to Active Directory Encryption.
          example: false
        adlogin:
          type: boolean
          description: >-
            Enable logging into BioStar X using the Windows Active Directory
            account.
          example: false
        RedirectionUri:
          type: string
          format: uri
          description: Required for Entra ID interworking.
          example: https://127.0.0.1/api/v2/entraid/auth
        adEnable:
          type: string
          description: Set to 0.
          example: '0'
        adType:
          type: string
          description: >-
            Interworking target classification. (Active Directory=`A`, Entra
            ID=`E`)
          enum:
            - A
            - E
          example: E
        prevAdType:
          type: string
          description: >-
            It is required to enter the previous connection information when
            modifying the interworking target. If there is no change, enter the
            current connection information.
          enum:
            - A
            - E
          example: E
        prevDomainName:
          type: string
          description: >-
            It is required to enter the previous connection information when
            modifying the interworking target. If there is no change, enter the
            current connection information.
          example: test.onmicrosoft.com
        prevServerAddr:
          type: string
          description: >-
            It is required to enter the previous connection information when
            modifying the interworking target. If there is no change, enter the
            current connection information.
          example: ''
        resetSync:
          type: boolean
          description: >-
            Delete existing users and user groups due to changes in connection
            information and set them to `true` if new settings are required.
          default: false
          example: false
        scheduleSyncInterval:
          type: integer
          description: >-
            Set the time interval for automatic synchronization. (`0`=Manual
            synchronization, `30` to `10080`=Automatic synchronization)
          minimum: 0
          maximum: 10080
          example: 0
        syncEvtCheck:
          type: boolean
          description: >-
            Settings for whether to leave event logs on BioStar X. (`true`=event
            logs are kept on BioStar X as usual.)
          example: false
        syncType:
          type: string
          description: >-
            Toggle automatic synchronization. (`N`=Manual synchronization,
            `A`=Automatic synchronization)
          enum:
            - 'N'
            - A
          example: 'N'
        useCustomField:
          type: boolean
          description: >-
            Set this parameter to `true` if a custom user field has been added
            via **Change AD User Mapping**. If no custom user field is being
            used, set the parameter to `false`.
          example: true
    QuickActionResponse:
      type: object
      properties:
        quick_action:
          type: array
          description: >-
            An array of quick action objects, each with the following
            properties.
          items:
            type: object
            properties:
              id:
                type: integer
                description: The quick action ID.
                example: 1
              name:
                type: string
                description: The quick action name.
                example: qc 1
              description:
                type: string
                description: The description of quick action.
                example: quick action test
              operator_levels:
                type: array
                description: >-
                  List Operator Level ID(s) which allowed to run the Quick
                  Action.
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: The operator level ID.
                      example: 1
                    permission:
                      type: object
                      description: The permission details.
                      properties:
                        id:
                          type: integer
                          description: The permission ID.
                          example: 1
                        name:
                          type: string
                          description: The permission name.
                          example: Administrator
                        description:
                          type: string
                          description: The permission description.
                          example: this is a permission for Administrator
                        jsonText:
                          type: string
                          description: The permission JSON text.
                          example: |-
                            {
                             
                               "module": {
                             
                                 "Dashboard": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                                 "User": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                                 "Device": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                                 "Door": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                                 "Elevator": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                                 "Zone": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                                 "AccessControl": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                                 "Monitoring": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                                 "TA": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                                 "Setting": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                                 "Video": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                                 "Visitor": {
                             
                                   "read": true,
                             
                                   "write": true
                             
                                 },
                             
                              "Report": {
                             
                                "read": true,
                             
                                "write": true
                             
                              }
                             
                               },
                             
                               "filter": {
                             
                                 "UserGroup": [
                             
                                   1
                             
                                 ],
                             
                                 "DeviceGroup": [
                             
                                   1
                             
                                 ],
                             
                                 "DoorGroup": [
                             
                                   1
                             
                                 ],
                             
                                 "ElevatorGroup": [
                             
                                   1
                             
                                 ],
                             
                                 "ZoneType": [
                             
                                   "-1"
                             
                                 ],
                             
                                 "AccessGroup": [
                             
                                   0
                             
                                 ],
                             
                                 "GraphicMapGroup": [
                             
                                   1
                             
                                 ]
                             
                               }
                             
                             }
                        createdAt:
                          type: string
                          format: date-time
                          description: The creation timestamp.
                          example: '2023-11-06T10:00:55.000+00:00'
              order_number:
                type: integer
                description: The order number of quick action.
                example: 1
              status:
                type: string
                description: The status of quick action.
                example: I
              confirm_before_run:
                type: string
                description: The confirm before run flag. (`Y` = enabled, `N` = disabled)
                example: 'Y'
              trigger_actions:
                $ref: '#/components/schemas/TriggerActionResponse'
        Response:
          $ref: '#/components/schemas/ApiResponse'
    TriggerActionResponse:
      type: object
      properties:
        id:
          type: integer
          description: The ID of the Quick Action.
          example: 1
        alarm_sets:
          type: array
          description: >-
            An array of trigger action objects, each with the following
            properties.
          items:
            type: object
            properties:
              alarmSetUID:
                type: integer
                description: The alarm action ID.
                example: 1
              name:
                type: string
                description: The trigger action name.
                example: ta 1
              prio:
                type: integer
                description: The priority.
                example: 0
              scheduleUID:
                type: integer
                description: The schedule ID.
                example: 1
              alarmType:
                type: integer
                description: The alarm type.
                example: 1
              alarmActionUID:
                type: integer
                description: The alarm action ID.
                example: 800001
              quickAction:
                type: string
                description: Is quick action enabled or not.
                example: 'Y'
    MultipleTriggerAction:
      type: object
      required:
        - name
        - priority
        - schedule_id
        - trigger
        - action
      properties:
        name:
          type: string
          description: Name of the Trigger & Action
        priority:
          type: integer
          description: Priority index of the Trigger & Action
        schedule_id:
          type: object
          properties:
            id:
              type: integer
              description: ID of the schedule which will be used by the trigger & action
        is_quick_action:
          type: string
          description: >
            Fill with character "Y" or "N". This parameter used to describe that
            the Trigger & Action can be use as a Quick Action
        trigger:
          type: object
          required:
            - source_type
            - event_types
            - devices
            - doors
            - zones
          properties:
            source_type:
              type: integer
              description: >
                Select a device/door/zone at which a specific event will be
                monitored. Multiple devices/doors/zones can be selected. The
                devices/doors/zones work independently even when they are
                disconnected from the BioStar server. (`1`=Device, `2`=Door,
                `3`=Zone)
            event_types:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: integer
                    description: >-
                      ID of the events which will trigger an action At least one
                      event must be selected.  <br>Event lists may be activated
                      differently depending on the options selected in Device,
                      Door, and Zone.
            devices:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: integer
                    description: >-
                      ID of the device which performs the action. You can select
                      a device or BioStar X to perform an action.
            doors:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: integer
                    description: ID of the door which will trigger an action.
            zones:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: integer
                    description: ID of the zone which will trigger an action
            device_action_id:
              type: object
              properties:
                device_id:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: ID of the device which will perform an action.
                relay_signal_id:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: >-
                        Relay of the device which will be used to perform an
                        action.
                relay_index:
                  type: integer
                  description: Relay index of the device.
        action:
          type: object
          required:
            - device_action_id
            - door_action
            - email_action_id
            - smtp_id
          properties:
            device_action_id:
              type: object
              properties:
                device_id:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: ID of the device which will perform an action.
                relay_signal_id:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: >-
                        Relay of the device which will be used to perform an
                        action.
                relay_index:
                  type: integer
                  description: Relay index of the device.
            door_action:
              type: array
              items:
                type: object
                properties:
                  door_id:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: ID of the door which will perform an action.
                  door_signal:
                    type: integer
                    description: >-
                      Door signal as operation of an action. Value between 345
                      and 348
            email_action_id:
              type: object
              properties:
                receipients:
                  type: array
                  items:
                    type: string
                  description: >-
                    List email recipients which BioStar X will send
                    notifications to. Use comma (,) to separate each email.
            smtp_id:
              type: object
              properties:
                id:
                  type: integer
                  description: >-
                    ID of the SMTP setting which will be used to send
                    notification email
    TriggerAction:
      type: object
      properties:
        name:
          type: string
          description: Name of the Trigger & Action
        priority:
          type: integer
          description: Priority index of the Trigger & Action
        schedule_id:
          type: object
          properties:
            id:
              type: integer
              description: ID of the schedule which will be used by the trigger & action
        trigger:
          type: object
          properties:
            source_type:
              type: integer
              description: >
                Select a device/door/zone at which a specific event will be
                monitored. Multiple devices/doors/zones can be selected. The
                devices/doors/zones work independently even when they are
                disconnected from the BioStar server. (`1`=Device, `2`=Door,
                `3`=Zone)
            event_types:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: integer
                    description: >-
                      ID of the events which will trigger an action At least one
                      event must be selected.  <br>Event lists may be activated
                      differently depending on the options selected in Device,
                      Door, and Zone.
            zones:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: ID of the zone which will trigger an action
        action:
          type: object
          properties:
            email_action_id:
              type: object
              properties:
                receipients:
                  type: array
                  items:
                    type: string
                  description: >-
                    List email recipients which BioStar X will send
                    notifications to. Use comma (,) to separate each email.
            smtp_id:
              type: object
              properties:
                id:
                  type: integer
                  description: >-
                    ID of the SMTP setting which will be used to send
                    notification email
    HolidayGroup:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Name of the holiday group
        description:
          type: string
          description: Description of the holiday group
        holidays:
          type: array
          required:
            - repeat_interval
            - start_date
          description: List of holidays in the group
          items:
            type: object
            properties:
              repeat_interval:
                type: integer
                description: >-
                  Repeat interval in years (`0`=no repeat, `1`=repeat every
                  year)
              start_date:
                type: string
                format: date-time
                description: Date and time of the holiday group
    Schedule:
      type: object
      properties:
        name:
          type: string
          description: Name of the schedule
        description:
          type: string
          description: Description of the schedule
        daily_schedules:
          type: array
          description: Daily schedules configuration
          items:
            type: object
            properties:
              day_index:
                type: integer
                description: >-
                  Day of the Week(`0`-sun, `1`-mon, `2`-tue, `3`-wed, `4`-thu,
                  `5`-fri, `6`-sat)
              time_segments:
                type: array
                description: Time segments for the day
                items:
                  type: object
                  properties:
                    start_time:
                      type: integer
                      description: Start time of the day (in minutes)
                    end_time:
                      type: integer
                      description: End time of the day (in minutes)
        holiday_schedules:
          type: array
          description: Holiday schedules used
          items:
            type: object
        days_of_iteration:
          type: integer
          description: Repeat schedule every N days
        start_date:
          type: string
          format: date-time
          description: Enable schedule from specified date
        use_daily_iteration:
          type: boolean
          description: Specify schedule weekly or daily. `False` for weekly
    FloorLevel:
      type: object
      properties:
        name:
          type: string
          description: Name of the floor level
        description:
          type: string
          description: Description of the floor level
        floor_level_items:
          type: array
          items:
            type: object
            properties:
              elevator_id:
                type: object
                properties:
                  id:
                    type: integer
                    description: ID of the elevator
              floors:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: ID of the floor in correspondence with the elevator
                    elevator_device_id:
                      type: object
                      properties:
                        device_id:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: Id of the device used by the elevator
                        relay_index:
                          type: integer
                          description: >-
                            Relay index used on the device according to the
                            `floors:id`
                    index:
                      type: integer
                      description: Index of the floor
              schedule_id:
                type: object
                properties:
                  id:
                    type: integer
                    description: ID of the schedule used
    ElevatorCollectionFloor:
      type: object
      properties:
        rows:
          type: array
          items:
            type: object
            required:
              - id
            properties:
              id:
                type: integer
                description: ID of the elevator.
                example: 32770
              floor:
                type: object
                required:
                  - order
                properties:
                  order:
                    type: integer
                    description: Index of the floor.
                    example: 3
    ElevatorCollection:
      type: object
      properties:
        rows:
          type: array
          items:
            type: object
            required:
              - id
            properties:
              id:
                type: integer
                description: ID of the elevator.
                example: 32770
    Elevator:
      type: object
      properties:
        name:
          type: string
          description: Name of the elevator. Max 48 characters.
          example: Odds
        description:
          type: string
          description: Description of the elevator. Max 255 characters.
          example: Odds elevator
        elevator_group_id:
          type: object
          properties:
            id:
              type: integer
              description: ID of the elevator group.
              example: 6
            name:
              type: string
              description: Name of the elevator group.
              example: New Elevator Group 2
        reader_devices:
          type: array
          description: List of reader devices.
          items:
            type: object
            properties:
              device_id:
                type: object
                properties:
                  id:
                    type: string
                    description: ID of the reader device.
                    example: '544140034'
                  name:
                    type: string
                    description: Name of the reader device.
                    example: BioEntry W2 544140034 (192.168.1.24)
        control_device_id:
          type: object
          properties:
            id:
              type: string
              description: ID of the control device.
              example: '544140034'
            name:
              type: string
              description: Name of the control device.
              example: BioEntry W2 544140034 (192.168.1.24)
            device_type_id:
              type: object
              properties:
                id:
                  type: string
                  description: ID of the device type.
                  example: '13'
                name:
                  type: string
                  description: Name of the device type.
                  example: BioEntry W2
        floors:
          type: array
          description: List of floors in the elevator.
          items:
            type: object
            properties:
              name:
                type: string
                description: Name of the floor.
                example: Odds - 1
              elevator_device_id:
                type: object
                properties:
                  device_id:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: ID of the elevator device.
                        example: 788930600
                      name:
                        type: string
                        description: Name of the elevator device.
                        example: OM-120 788930600
                  relay_index:
                    type: integer
                    description: Relay index for the floor.
                    example: 0
              order:
                type: integer
                description: Order of the floor.
                example: 0
        module_devices:
          type: array
          description: List of module devices.
          items:
            type: object
            properties:
              device_id:
                type: object
                properties:
                  id:
                    type: string
                    description: ID of the module device.
                    example: '788930600'
                  name:
                    type: string
                    description: Name of the module device.
                    example: OM-120 788930600
        trigger_actions:
          type: array
          description: List of trigger actions.
          items:
            type: object
          example: []
        active_timeout:
          type: string
          description: Active timeout duration.
          example: '10'
        dual_authentication:
          type: object
          properties:
            device:
              type: integer
              description: Device for dual authentication.
              example: 0
            approval_type:
              type: string
              description: Approval type for dual authentication.
              example: '0'
            timeout:
              type: integer
              description: Timeout duration for dual authentication.
              example: 15
            schedule_id:
              type: object
              properties:
                id:
                  type: string
                  description: ID of the schedule.
                  example: '1'
            approval_groups:
              type: array
              description: List of approval groups.
              items:
                type: object
              example: []
        tamper_device:
          type: object
          properties:
            device_id:
              type: object
              example: {}
            switch_type:
              type: string
              description: Switch type for tamper device.
              example: '0'
    ElevatorGroup:
      type: object
      properties:
        ElevatorGroup:
          type: object
          required:
            - parent_id
            - isElevatorGroups
            - depth
            - inherited
            - name
          properties:
            parent_id:
              type: object
              required:
                - id
              properties:
                id:
                  type: integer
                  description: ID of the parent of the elevator group which will be created
                  example: 1
            isElevatorGroups:
              type: boolean
              description: Marker for elevator group
              example: true
            depth:
              type: integer
              description: >-
                Depth of the group in accordance with the parent group (parent
                depth+1). Value between 1 to 8.
              example: 1
            sync_device_groups:
              type: array
              description: Synchronized device groups
              items:
                type: object
              example: []
            sync_devices:
              type: array
              description: Synchronized devices
              items:
                type: object
              example: []
            inherited:
              type: boolean
              description: Inheritance marker of the group
              example: true
            iconCls:
              type: string
              description: Icon class for the elevator group
              example: elevatorGroupIcon
            text:
              type: string
              description: Text for the elevator group
              example: New Elevator Group 2
            name:
              type: string
              description: >-
                Name of the elevator group. Up to 48 characters may be entered
                for an elevator group name.
              example: New Elevator Group 2
    DoorCollection:
      type: object
      properties:
        rows:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: ID of the door
    TimedAntiPassBackConfig:
      type: object
      properties:
        AntiPassBackConfig:
          type: object
          properties:
            Door:
              type: object
              properties:
                DoorCollection:
                  $ref: '#/components/schemas/DoorCollection'
            User:
              type: array
              items:
                type: object
                properties:
                  user_id:
                    type: integer
                    description: User ID of the user
            UserType:
              type: integer
              description: AntiPassback config User Type. (`1`=All, `2`=Specific)
        target:
          type: string
          description: User target, all users or single user.
    Door:
      type: object
      properties:
        name:
          type: string
          description: Name of the door
        description:
          type: string
          description: Description of the door
        door_group_id:
          type: object
          required:
            - id
          properties:
            id:
              type: integer
              description: ID of the Door Group which the door will be under
        open_timeout:
          type: integer
          description: Configure the maximum allowed time for the door to remain open.
        open_duration:
          type: integer
          description: >-
            Set the duration for which the door will remain open after a user
            authentication is completed. When the authentication is successful,
            the relay will be activated for the set time. When this time
            elapses, the relay no longer sends the signal to the door. Open Time
            may vary depending on the type of door lock used.
        open_once:
          type: boolean
          description: >-
            Lock when door is closed. When the door sensor detects that the door
            is closed, the door is locked. Set this option to false if
            `unconditional_lock` is true. Set true to enable this parameter.
            (Default= `false`)
        unconditional_lock:
          type: boolean
          description: >-
            Use Automatic Door. When using an automatic door as an entrance
            door, a relay can operate regardless of the status of a door sensor.
            Set this option as false if open_once is set to true.
        relay_output_id:
          type: object
          properties:
            device_id:
              type: object
              required:
                - id
              properties:
                id:
                  type: integer
                  description: >-
                    Device ID which the relay will be used to control the door
                    lock.
            relay_index:
              type: integer
              description: Relay index of the device which will be used.
        exit_button_input_id:
          type: object
          properties:
            device_id:
              type: object
              required:
                - id
              properties:
                id:
                  type: integer
                  description: Device ID which will be used as exit control.
            input_index:
              type: integer
              description: Exit index of the device which will be used.
            type:
              type: integer
              description: Normally Closed=`1`, Normally Open=`0`
        sensor_input_id:
          type: object
          properties:
            device_id:
              type: object
              required:
                - id
              properties:
                id:
                  type: integer
                  description: Device ID which will be used as sensor control.
            input_index:
              type: integer
              description: Sensor index of the device which will be used.
            type:
              type: integer
              description: Normally Closed=`1`, Normally Open=`0`
            apb_use_door_sensor:
              type: integer
              description: >-
                Set whether to use the door sensor when using Entry Confirmed
                APB.
    DeviceCollectionID:
      type: object
      properties:
        rows:
          type: array
          items:
            type: object
            required:
              - id
            properties:
              id:
                type: integer
                description: ID of the device
                example: 544140034
    AuditSearchInput:
      type: object
      description: Input for searching audit trail logs with filtering and pagination
      required:
        - Query
      properties:
        Query:
          type: object
          description: Search query configuration with conditions and pagination
          required:
            - limit
          properties:
            offset:
              type: integer
              description: Offset the response's records by the specified value.
              example: 0
            limit:
              type: integer
              description: Limit the number of response's records by the specified value.
              example: 50
            total:
              type: boolean
              description: >-
                Toggle true to get total count of the Audit Trail based on
                condition(s) set.
              default: false
              example: false
            conditions:
              type: array
              description: Array of search conditions to filter audit logs
              items:
                $ref: '#/components/schemas/AuditSearchCondition'
    AuditSearchCondition:
      type: object
      description: Individual search condition for filtering audit logs
      properties:
        column:
          type: string
          description: Column/field to search on
          enum:
            - DATE
            - USRID
            - PERM
            - IP
            - MENU
            - TARGET
            - METHOD
          example: DATE
        operator:
          type: integer
          description: >-
            Search operator type:

            - `2`: Equals/Contains operation (for USRID, PERM, IP, MENU, TARGET,
            METHOD)

            - `3`: Range operation (for DATE - requires from and to values)
          enum:
            - 2
            - 3
          example: 3
        values:
          type: array
          description: >-
            Array of search values. Format depends on column type:


            * **DATE**: Two ISO-8601 timestamps [from, to] for date range

            * **USRID**: Make use of Audit Search User to get the required
            value. Value format \["UserName(UserID)"\]. Use comma (,) to
            separate values.

            * **PERM**: Make use of Audit Search Operator Level to get the
            required value. Use comma (,) to separate values.

            * **IP**: Make use of Audit Search IP List to get the required
            value. Use comma (,) to separate values.

            * **MENU**: System module names. Use comma (,) to separate values.
              
              * access_level

              * access_group

              * setting
              
              * user
              
              * device
              
              * door

              * elevator

              * zone

              * floor_level

            * **TARGET**: Make use of Audit Search Target List to get the
            required value. Use comma (,) to separate values.

            * **METHOD**: Action type IDs (1=Add, 3=Update, 4=Delete, 5=Action).
            Use comma (,) to separate values.
          items:
            type: string
          minItems: 1
          example:
            - '2024-02-17T16:00:00.000Z'
            - '2024-03-18T15:59:59.000Z'
    UserReportInput:
      type: object
      description: >-
        Input for generating user reports with advanced search and display
        configuration
      required:
        - View
        - adv_criteria
      properties:
        View:
          type: object
          description: Report configuration and layout settings
          required:
            - Query
            - display_fields
            - name
            - content_type
            - page_size
            - page_portrait
          properties:
            Query:
              type: object
              description: Query configuration for data collection
              required:
                - collection_name
                - object
                - orders
              properties:
                collection_name:
                  type: string
                  description: Name of the data collection to query
                  example: UserCollection
                object:
                  type: string
                  description: Type of object being queried
                  example: query
                orders:
                  type: array
                  description: Array of sort orders for the report data
                  items:
                    type: object
                    properties:
                      column:
                        type: string
                        description: Column name to sort by
                        example: user_id
                      descending:
                        type: string
                        description: >-
                          Sort direction (true for descending, false for
                          ascending)
                        enum:
                          - 'true'
                          - 'false'
                        example: 'false'
            display_fields:
              type: array
              description: Array of fields to display in the report
              minItems: 1
              items:
                type: object
                required:
                  - name
                  - display_name
                  - display_type
                  - width
                properties:
                  name:
                    type: string
                    description: Database field name to retrieve data from
                    example: user_id
                  display_name:
                    type: string
                    description: Column name to show in SVG/PDF file
                    example: ID
                  display_type:
                    type: string
                    description: Data type for display formatting
                    enum:
                      - string
                      - enum
                      - objects
                      - number
                      - date
                    example: string
                  width:
                    type: integer
                    minimum: 1
                    description: Column width in SVG/PDF file
                    example: 5
                  enum:
                    type: array
                    description: >-
                      Enum mappings for display (only used when display_type is
                      enum)
                    items:
                      type: string
                    example:
                      - false=Active
                      - true=Inactive
            name:
              type: string
              description: Name of the report
              example: All Users
            show_title_every_page:
              type: boolean
              description: Whether to show title on every page
              default: false
              example: false
            group_by_page_break:
              type: boolean
              description: Indicates if the report will group by page break
              default: false
              example: false
            footer_report_date:
              type: boolean
              description: Indicates whether to show the date in the report footer
              default: true
              example: true
            footer_comment:
              type: string
              description: Custom comment text for report footer
              example: Created by Administrator
            footer_display_page_number:
              type: boolean
              description: Whether to display page numbers in footer
              default: true
              example: true
            content_type:
              type: string
              description: Output format for the report
              enum:
                - PDF
                - SVG
              example: PDF
            page_size:
              type: string
              description: Page size for the report
              enum:
                - A4
                - Letter
                - A3
                - Legal
              example: A4
            page_portrait:
              type: boolean
              description: Page orientation (`true` for portrait, `false` for landscape)
              example: false
        adv_criteria:
          $ref: '#/components/schemas/AdvancedSearchCriteria'
        reaseon:
          type: string
          description: Reason for generating the user report
          example: For audit purposes
    UserReportResponse:
      type: object
      description: Response from user report generation
      properties:
        FileCollection:
          type: object
          description: Information about the generated report files
          properties:
            total:
              type: string
              description: Total number of files generated
              example: '1'
            rows:
              type: array
              description: Array of file information
              items:
                type: object
                properties:
                  uri:
                    type: string
                    description: File path/URI for downloading the report
                    example: /report/list_20241030093819_7596.pdf
                  type:
                    type: string
                    description: MIME type of the generated file
                    enum:
                      - application/pdf
                      - image/svg+xml
                    example: application/pdf
        Response:
          $ref: '#/components/schemas/ApiResponse'
    UserDataImportInput:
      type: object
      description: Input for importing user data from device-compatible file format
      required:
        - file
      properties:
        file:
          type: object
          description: Information about the uploaded device file
          required:
            - originalName
            - name
          properties:
            originalName:
              type: string
              description: Original filename of the uploaded file
              pattern: ^.*\.tgz$
              example: BioStar2_20241103_143708.tgz
            name:
              type: string
              description: >-
                Current filename of the file on server (from /api/attachments
                response)
              pattern: ^.*\.tgz$
              example: BioStar2_20241103_143708.tgz
    UserDataExportInput:
      type: object
      description: Input for exporting user data to device-compatible file format
      required:
        - device_type
        - group_id
        - adv_criteria
      properties:
        device_type:
          type: integer
          description: |-
            Device type for which the exported data will be applied
            - `8`: "BioStation 2 (FW 1.9.0 or later)"
            - `9`: "BioStation A2 (FW 1.8.0 or later)"
            - `10`: "FaceStation 2 (FW 1.4.0 or later)"
            - `29`: "FaceStation F2 (FW 1.0.0 or later)"
            - `32`: "X-Station 2 (FW 1.0.0 or later)"
          example: 35
        group_id:
          type: integer
          description: Group ID of the device
          minimum: 1
          example: 1
        adv_criteria:
          allOf:
            - $ref: '#/components/schemas/AdvancedSearchCriteria'
            - type: object
              description: Advanced search criteria to filter users for export
              example:
                limit: 50
                order_by: user_id:false
                user_group_ids:
                  - 1121
                user_operator_level_id: 0
        reason:
          type: string
          description: Reason for exporting user data (Supported in v1.0.1 and later)
          example: For device migration
    UserCsvImportInput:
      type: object
      description: >-
        Input for importing user data from CSV file with field mapping and
        options
      required:
        - File
        - CsvOption
        - Query
      properties:
        File:
          type: object
          description: Information about the uploaded CSV file
          required:
            - uri
            - fileName
          properties:
            uri:
              type: string
              description: Path/URI of the uploaded CSV file on the server
              example: User_Test.csv
            fileName:
              type: string
              description: Original filename of the CSV file
              example: User_Test.csv
        CsvOption:
          type: object
          description: Import configuration and options
          required:
            - start_line
            - import_option
          properties:
            start_line:
              type: integer
              description: Row number to start data import (1-based indexing)
              example: 2
            import_option:
              type: integer
              description: >-
                Options when same ID exist in BioStar X. (`1`=Preserve Data,
                `2`=Overwrite Data)
              enum:
                - 1
                - 2
              example: 1
        Query:
          type: object
          description: Field mapping configuration between CSV and database
          required:
            - headers
            - columns
          properties:
            headers:
              type: array
              description: >-
                Column headers from the CSV file in order. Use empty string to
                skip columns.
              items:
                type: string
              example:
                - user_id
                - name
                - department
                - user_title
                - phone
                - email
                - user_group
                - start_datetime
                - expiry_datetime
                - csn
                - ''
                - ''
                - ''
                - qr
                - 26 bit SIA Standard-H10301
                - HID 37 bit-H10302
                - ''
                - ''
                - ''
                - Purpose
                - License Plate Number
                - Hello
                - Hair Color
                - Hair Color 2
                - ''
                - ''
                - ''
            columns:
              type: array
              description: >-
                Corresponding BioStar X database field names. Must match headers
                array length.
              items:
                type: string
                enum:
                  - user_id
                  - name
                  - department
                  - user_title
                  - phone
                  - email
                  - user_group
                  - start_datetime
                  - expiry_datetime
                  - csn
                  - mobile_start_datetime
                  - mobile_expiry_datetime
                  - csn_mobile
                  - qr
                  - 26 bit SIA Standard-H10301
                  - HID 37 bit-H10302
                  - HID 37 bit-H10304
                  - HID Corporate 1000
                  - HID Corporate 1000 48bit
                  - face_image_file1
                  - face_image_file2
                  - pin
                  - login_id
                  - access_groups
                  - fingerprint_template_count
                  - face_count
                  - visual_face_count
                  - card_count
                  - have_pin
                  - qr_count
                  - mobile_count
                  - disabled
              example:
                - user_id
                - name
                - department
                - user_title
                - phone
                - email
                - user_group
                - start_datetime
                - expiry_datetime
                - csn
                - mobile_start_datetime
                - mobile_expiry_datetime
                - csn_mobile
                - qr
                - 26 bit SIA Standard-H10301
                - HID 37 bit-H10302
                - HID 37 bit-H10304
                - HID Corporate 1000
                - HID Corporate 1000 48bit
                - face_image_file1
                - face_image_file2
                - pin
                - login_id
                - access_groups
                - fingerprint_template_count
                - face_count
                - visual_face_count
                - card_count
                - have_pin
                - qr_count
                - mobile_count
                - disabled
    UserCsvExportInput:
      type: object
      description: >-
        Input for exporting user data as CSV with customizable columns and
        headers
      required:
        - Query
        - adv_criteria
      properties:
        Query:
          type: object
          description: Data criteria and formatting options for CSV export
          required:
            - offset
            - group_by
            - columns
            - headers
          properties:
            offset:
              type: integer
              description: Data offset for pagination
              minimum: 0
              example: 0
            group_by:
              type: integer
              description: Group by column identifier
              example: 1
            columns:
              type: array
              description: Array of column names to include in the CSV export
              items:
                type: string
                enum:
                  - user_id
                  - name
                  - email
                  - user_group_id
                  - access_groups
                  - start_datetime
                  - expiry_datetime
                  - operator_level
                  - fingerprint_template_count
                  - face_count
                  - visual_face_count
                  - card_count
                  - have_pin
                  - qr_count
                  - mobile_count
                  - disabled
                  - department
                  - user_title
                  - phone
                  - login_id
              example:
                - user_id
                - name
                - email
                - user_group_id
                - access_groups
                - start_datetime
                - expiry_datetime
                - operator_level
                - fingerprint_template_count
                - face_count
                - visual_face_count
                - card_count
                - have_pin
                - qr_count
                - mobile_count
                - disabled
            headers:
              type: array
              description: Array of human-readable column headers for the CSV file
              items:
                type: string
              example:
                - ID
                - Name
                - Email
                - Group
                - Access Group
                - Start datetime
                - End datetime
                - Operator Level
                - Fingerprint
                - Face
                - Visual Face
                - Card
                - PIN
                - QR/Barcode
                - Mobile Access Card
                - Status
        adv_criteria:
          allOf:
            - $ref: '#/components/schemas/AdvancedSearchCriteria'
            - type: object
              description: Advanced search criteria to filter users for export
              example:
                user_group_ids: []
                user_group_id: 1
                user_operator_level_id: 0
                limit: 1000
                order_by: user_id:false
        reason:
          type: string
          description: Reason for exporting user data (Supported in v1.0.1 and later)
          example: For backup
    UserSearchInput:
      type: object
      description: Input for basic user search functionality
      required:
        - limit
      properties:
        limit:
          type: integer
          description: >-
            Limit response record(s) by the value specified on this parameter.
            Use 0 for no limit.
          minimum: 0
          example: 50
        search_text:
          type: string
          description: >-
            Search record(s) with the text specified on this parameter. Performs
            like search across user fields.
          nullable: true
          example: John
        user_group_id:
          type: integer
          description: >-
            Filter response record(s) according to user_group_id specified on
            this parameter
          nullable: true
          example: 1
        order_by:
          type: string
          description: >-
            Order the response record(s) by the User parameter such as user_id
            or name. Format is `field_name:false` for ascending,
            `field_name:true` for descending.
          example: user_id:false
    AdvanceSearchUser:
      type: object
      description: >-
        User object for advance search API response with complete user
        information
      properties:
        user_id:
          type: string
          description: Unique identifier of the user
          example: '45'
        name:
          type: string
          description: Full name of the user
          example: Suprema
        email:
          type: string
          format: email
          description: Email address of the user
          example: one@suprema.com
        department:
          type: string
          description: Department of the user
          example: Your Dept
        user_title:
          type: string
          description: Title of the user
          example: Your Title
        phone:
          type: string
          description: User phone number
          example: '085697068105'
        user_group_id:
          type: object
          description: User group information
          properties:
            id:
              type: integer
              description: User group ID
              example: 1004
            name:
              type: string
              description: User group name
              example: user group1
        operator_level:
          type: string
          description: Operator level/permission of the user
          example: User
        fingerprint_template_count:
          type: integer
          description: Number of fingerprint templates
          example: 0
        face_count:
          type: integer
          description: Number of face templates
          example: 0
        visual_face_count:
          type: integer
          description: Count of visual face templates
          example: 0
        mobile_count:
          type: integer
          description: Count of mobile credentials
          example: 0
        qr_count:
          type: integer
          description: Count of QR credentials
          example: 0
        card_count:
          type: integer
          description: Number of cards
          example: 1
        start_datetime:
          type: string
          format: date-time
          description: User access start date and time
          example: '2001-01-01T00:00:00'
        expiry_datetime:
          type: string
          format: date-time
          description: User access expiry date and time
          example: '2037-12-31T23:59:00'
        last_modified:
          type: integer
          description: Last modification timestamp
          example: 5
        updated_count:
          type: integer
          description: Number of times user has been updated
          example: 0
        login_id:
          type: string
          description: Login ID of the user
          example: Abrar
        disabled:
          type: boolean
          description: Whether user is disabled
          example: false
        have_pin:
          type: boolean
          description: Does user have PIN
          example: true
        access_groups:
          type: array
          description: List of access groups assigned to the user
          items:
            type: object
            properties:
              id:
                type: integer
                description: Access group ID
                example: 1
              name:
                type: string
                description: Access group name
                example: access group 3
              users:
                type: array
                description: Users in this access group
                items:
                  type: object
              user_groups:
                type: array
                description: User groups in this access group
                items:
                  type: object
              access_levels:
                type: array
                description: Access levels for this access group
                items:
                  type: object
              floor_levels:
                type: array
                description: Floor levels for this access group
                items:
                  type: object
        user_custom_fields:
          type: array
          description: User's custom fields
          items:
            type: object
            properties:
              custom_field:
                type: object
                description: Custom field definition
                properties:
                  id:
                    type: integer
                    description: Custom field ID
                    example: 1
                  name:
                    type: string
                    description: Custom field name
                    example: CF1
                  type:
                    type: integer
                    description: Custom field type (0=text, 1=number, 2=dropdown, 3=file)
                    example: 0
                  order:
                    type: integer
                    description: Display order of the custom field
                    example: 1
              item:
                type: string
                description: Value of the custom field
                example: custom field 1
              user_id:
                type: object
                description: User reference for this custom field
                properties:
                  user_id:
                    type: string
                    description: User ID
                    example: '45'
                  name:
                    type: string
                    description: User name
                    example: Suprema
    AdvancedSearchCriteria:
      type: object
      description: Advanced Search criteria for finding users
      required:
        - limit
        - order_by
        - user_operator_level_id
      properties:
        limit:
          type: integer
          description: The maximum number of users to return. Default is 50.
          example: 50
        offset:
          type: integer
          description: >-
            The number of users to skip before starting to return results.
            Default is 0.
          example: 0
        user_id:
          type: string
          description: The User ID to search, supports like search
          example: '11'
        order_by:
          type: string
          description: >-
            Order, will accept with format `properties:false`, for example if we
            want to order by name, it will be `user_name:false`. (`false` =
            ASCENDING and `true` = DESCENDING)
          example: user_id:false
        user_group_id:
          type: integer
          description: Group ID for search user. Also gets the child user group
          example: 1
        user_group_ids:
          type: array
          description: Array of Group IDs for advanced search parameter
          items:
            type: integer
          example:
            - 1121
        user_name:
          type: string
          description: >-
            User name for Advance Search parameter, supports like search both
            encrypted and unencrypted
          example: John
        user_email:
          type: string
          format: email
          description: User email, supports like search both encrypted and unencrypted
          example: abc@gmail.com
        user_phone:
          type: string
          description: >-
            User Phone for Advance Search parameter, supports like search both
            encrypted and unencrypted
          example: 123-456-7890
        user_access_group_ids:
          type: string
          description: >-
            User access group id for advance search parameter, supports multiple
            value with format String with Delimiter , i.e 1,2,3.


            \* = User(s) who have any Access Group.


            void = User(s) who does not belong to any Access Group.
          example: 17,18
        user_operator_level_id:
          type: integer
          description: >-
            User operator level id for Advance Search parameter Value `0` = user
            with all operator level, `-1` = user with no operator level, else ID
            of operator level
          example: 0
        user_department:
          type: string
          description: >-
            User Department for Advance Search parameter, supports like search
            on unencrypted and exact search on encrypted
          example: Engineering
        user_title:
          type: string
          description: >-
            User title for advance search parameter, supports like search on
            unencrypted and exact search on encrypted
          example: Manager
        user_card:
          type: string
          description: User card ID to search
          example: '123456'
        user_custom_field_1:
          type: string
          description: >-
            Custom fields for advance search parameter support like search on
            unencrypted and exact search on encrypted
          nullable: true
        user_custom_field_2:
          type: string
          description: >-
            Custom fields for advance search parameter support like search on
            unencrypted and exact search on encrypted
          nullable: true
        user_custom_field_3:
          type: string
          description: >-
            Custom fields for advance search parameter support like search on
            unencrypted and exact search on encrypted
          nullable: true
        user_custom_field_4:
          type: string
          description: >-
            Custom fields for advance search parameter support like search on
            unencrypted and exact search on encrypted
          nullable: true
        user_custom_field_5:
          type: string
          description: >-
            Custom fields for advance search parameter support like search on
            unencrypted and exact search on encrypted
          nullable: true
        user_custom_field_6:
          type: string
          description: >-
            Custom fields for advance search parameter support like search on
            unencrypted and exact search on encrypted
          nullable: true
        user_custom_field_7:
          type: string
          description: >-
            Custom fields for advance search parameter support like search on
            unencrypted and exact search on encrypted
          nullable: true
        user_custom_field_8:
          type: string
          description: >-
            Custom fields for advance search parameter support like search on
            unencrypted and exact search on encrypted
          nullable: true
        user_custom_field_9:
          type: string
          description: >-
            Custom fields for advance search parameter support like search on
            unencrypted and exact search on encrypted
          nullable: true
        user_custom_field_10:
          type: string
          description: >-
            Custom fields for advance search parameter support like search on
            unencrypted and exact search on encrypted
          nullable: true
        user_status:
          type: boolean
          description: >-
            User status for advance search parameter. `false` = Active, `true` =
            Inactive
          enum:
            - false
            - true
          example: false
    UserAbsenceQueryInput:
      type: object
      description: Input for querying user absence/idle data
      required:
        - Query
      properties:
        Query:
          type: object
          required:
            - offset
            - limit
          properties:
            offset:
              type: integer
              description: Number of records to skip
              minimum: 0
              example: 0
            limit:
              type: integer
              description: Maximum number of records to return (0 for no limit)
              minimum: 0
              example: 0
            conditions:
              type: array
              description: Array of search conditions
              items:
                type: object
                required:
                  - column
                  - operator
                  - values
                properties:
                  column:
                    type: string
                    description: Column name to search in
                    example: user_id
                  operator:
                    type: integer
                    description: >-
                      Search operator (1=equals, 2=contains, 3=starts_with,
                      etc.)
                    example: 2
                  values:
                    type: array
                    description: Array of values to search for
                    items:
                      oneOf:
                        - type: string
                        - type: integer
                    example:
                      - 1
                      - 2
                      - 4
            orders:
              type: array
              description: Array of ordering specifications
              items:
                type: object
                required:
                  - column
                  - descending
                properties:
                  column:
                    type: string
                    description: Column name to order by
                    example: user_id
                  descending:
                    type: boolean
                    description: Whether to sort in descending order
                    example: false
    DeviceResponse:
      type: object
      description: Common response structure from device operations
      properties:
        rows:
          type: array
          description: List of device operation results
          items:
            type: object
            properties:
              id:
                type: string
                description: Device ID
                example: '50362288'
              code:
                type: string
                description: Response code from device (0=Success)
                example: '0'
        result:
          type: string
          description: >-
            Summary of device response. 'true' when all devices successfully
            updated, 'false' when any device failed
          example: 'true'
    UserRemoveFromDeviceInput:
      type: object
      description: Input for removing user data from devices with advanced search
      required:
        - DeviceCollection
        - adv_criteria
      properties:
        DeviceCollection:
          type: object
          required:
            - rows
          properties:
            rows:
              type: array
              description: Array of device IDs from which user data will be deleted
              minItems: 1
              items:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
                    description: ID of the device
                    example: '40000701'
        adv_criteria:
          $ref: '#/components/schemas/AdvancedSearchCriteria'
    UserDeviceOperationResponse:
      type: object
      description: Response from device operation (export/remove)
      properties:
        DeviceResponse:
          $ref: '#/components/schemas/DeviceResponse'
        Response:
          $ref: '#/components/schemas/ApiResponse'
    UserExportInput:
      type: object
      description: Basic input for exporting user data to device
      required:
        - DeviceCollection
      properties:
        DeviceCollection:
          type: object
          required:
            - rows
          properties:
            rows:
              type: array
              description: Array of device IDs to export user data to
              minItems: 1
              items:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
                    description: ID of the device
                    example: '50362288'
    UserExportAdvancedInput:
      type: object
      description: Advanced input for exporting user data to device with search criteria
      required:
        - DeviceCollection
        - adv_criteria
      properties:
        DeviceCollection:
          type: object
          required:
            - rows
          properties:
            rows:
              type: array
              description: Array of device IDs to export user data to
              minItems: 1
              items:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
                    description: ID of the device
                    example: '50362288'
        adv_criteria:
          $ref: '#/components/schemas/AdvancedSearchCriteria'
    UserExportResponse:
      type: object
      description: Response from user export operation
      properties:
        DeviceResponse:
          $ref: '#/components/schemas/DeviceResponse'
        Response:
          $ref: '#/components/schemas/ApiResponse'
    UserBulkUpdateResponse:
      type: object
      description: Response from bulk update operation
      properties:
        UserCollection:
          type: object
          description: Collection of user update results
          properties:
            rows:
              type: array
              description: Array of user update results
              items:
                type: object
                properties:
                  user_id:
                    type: string
                    description: User ID that was updated
                    example: '3'
                  ret_code:
                    type: string
                    description: Return code for the user update (0=Success, other=Error)
                    example: '0'
        Response:
          $ref: '#/components/schemas/ApiResponse'
    UserBulkUpdateInput:
      type: object
      description: Input for bulk updating user information
      required:
        - UserCollection
      properties:
        UserCollection:
          type: object
          required:
            - rows
          properties:
            rows:
              type: array
              description: Array of user objects to update (maximum 100 users)
              maxItems: 100
              minItems: 1
              items:
                type: object
                required:
                  - user_id
                properties:
                  user_id:
                    type: string
                    description: >-
                      User ID of the user. This will be used as the update
                      target
                    example: '9'
                  name:
                    type: string
                    maxLength: 48
                    description: Name of the user. Up to 48 characters
                    example: John Doe
                  user_group_id:
                    type: object
                    description: User Group information
                    properties:
                      id:
                        type: string
                        description: User Group ID
                        example: '1'
                  disabled:
                    type: boolean
                    description: >-
                      Toggle User active or not; false for active, true for
                      non-active
                    example: false
                  start_datetime:
                    type: string
                    format: date-time
                    description: Start active period for the User
                    example: '2001-01-01T00:00:00.00Z'
                  expiry_datetime:
                    type: string
                    format: date-time
                    description: End active period for the User
                    example: '2030-12-31T23:59:00.00Z'
                  email:
                    type: string
                    format: email
                    description: Email address of the User
                    example: SW1_00003@gmail.com
                  department:
                    type: string
                    maxLength: 64
                    description: Department of the User. Up to 64 characters
                    example: Engineering
                  user_title:
                    type: string
                    description: Title of the User
                    example: Manager
                  login_id:
                    type: string
                    description: Login ID of the user
                    example: myloginid
                  password:
                    type: string
                    description: Password for the user
                    example: zlwRzi7Kcpi1kiQ
                  user_ip:
                    type: string
                    description: >-
                      Limit the access of the User so he/she can only login from
                      the registered IP Address
                    example: 191.59.135.73
    UserFingerprintUpdateInput:
      type: object
      description: Input for updating user fingerprint credentials
      required:
        - User
      properties:
        User:
          type: object
          required:
            - fingerprint_templates
          properties:
            fingerprint_templates:
              type: array
              description: Array of fingerprint templates for the user
              minItems: 1
              maxItems: 10
              items:
                type: object
                required:
                  - template0
                  - template1
                properties:
                  finger_mask:
                    type: boolean
                    description: >-
                      Set to true to mark the fingerprint as a duress
                      fingerprint. When threatened by someone to open the door,
                      the user can authenticate using this fingerprint to send
                      an alarm signal to BioStar X.
                    example: false
                  template0:
                    type: string
                    description: First scan template of the fingerprint (Raw data)
                    example: >-
                      RSoQFLAAVUYMBEBvBBlEsWSLFITAEIUGBgEYBA/G0W0IAwcgdgEbh2ANixfIMGUKEshwF4QOCbBzhjXEsaCFJITQAYohRSBViCSGoUsRLAcQooYoh6GlCDpIgZ2GKMkARgkyCXCehDhJgEIDG0sxYJsOy0BziBaMcGmPG4ywUaAVTdBokwxOEXgHEE6AeIIVT0FoERfPYBsxGg9gK9EK0QB4jRxSYRqFEhNAbxkXk1AUChiTUHSHL8zwl4EmDiE3CCHPADWKK5DAOo8nUZAqDS5SIUKXK9JhOZj////g/////////eAB///////d4AEi/////N3gASM////M3eABIzT/+7zd4BIzRE+7u83gEjNET7u7zeASNERFu7vN4BI0REW6u8zgIzRERaqqvOAjRERFqqq84TREREWqqrziNFVUT6mqvOJFVVVfqqq9BFVVVU/5qrqHd2ZU//+qqZiIdkT///qqqZh1T///+6qqqYX/////u6uqj///
                  template1:
                    type: string
                    description: Second scan template of the fingerprint (Raw data)
                    example: >-
                      RSgQFK8AVUYRBDBvhxqEgBGFHsSRZwsIhRF1BQtGIRuEFsZxawgJRwB5AR4H4GULGYgQF4UUyYB0hyqEsAOJJsTRWIgrRkBKjyKG4QoLMsbwooQvB3GkBi9I0EYHOUnBnQMJSgF4ghXK8HWKHYwQZ5EIzQAfhRPN4XsEHA4BbBYXzhB5hRzO8WaYB89AdoQeT0AdsQgQAHiJDlFQdoIiSvFfHCLMcE4iNszwmAIszkE2hihO8DQJIM9QKkMxEJA3CC4RwCeOIlKBHAMxEsBFIv///d3////////M3eD/////+8zd4BL///+7zN3gEj//+rvM3eASM/+qu8zd4BIzT6q7vM3gEjRFqqq7zeASNESqqrvN4CNERaqqq7zhI0RFqqqrvOE0REWqqqq84jRFVaqqqrwDRFVVqqmavQRVVVWqqqq9JVVVVvq7qqmHdmZv/6qqqZiHZm//+qqqmZhV////u6qqmFT///+7uqqoT/8=
                  isNew:
                    type: boolean
                    description: Indicates if this is a new fingerprint template
                    example: true
    UserBatchEditResponse:
      type: object
      description: Response from batch edit operation
      properties:
        FailedUserCollection:
          type: object
          description: Collection of users that failed to be edited
          properties:
            total:
              type: string
              description: Total number of failed users
              example: '0'
            rows:
              type: array
              description: Array of failed user details
              items:
                type: object
                properties:
                  user_id:
                    type: string
                    description: User ID that failed
                  error_message:
                    type: string
                    description: Error message for the failure
        Response:
          $ref: '#/components/schemas/ApiResponse'
    UserBatchEditInput:
      type: object
      description: Input for batch editing users with advanced search
      required:
        - User
        - adv_criteria
      properties:
        User:
          type: object
          description: User data to change
          properties:
            start_datetime:
              type: string
              format: date-time
              description: Start active period for the User
              example: '2001-01-02T00:00:00.00Z'
            expiry_datetime:
              type: string
              format: date-time
              description: End active period for the User
              example: '2035-12-31T23:59:00.00Z'
            disabled:
              type: boolean
              description: Toggle User active or not; false for active, true for non-active
              example: true
            user_group_id:
              type: object
              description: User Group information
              properties:
                id:
                  type: integer
                  description: User Group ID
                  example: 242894
                name:
                  type: string
                  description: User Group name
                  example: test 2
                parent_id:
                  type: object
                  description: Parent group information
                  properties:
                    id:
                      type: integer
                      description: Parent group ID
                      example: 1
            permission:
              type: object
              description: Permission level for the user
              properties:
                id:
                  type: integer
                  description: Permission ID
                  example: 2
            access_groups:
              type: array
              description: Access groups for the user
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: Access Group ID
                    example: '14'
        adv_criteria:
          $ref: '#/components/schemas/AdvancedSearchCriteria'
    UserInput:
      type: object
      description: Input for creating a new user
      required:
        - User
      properties:
        User:
          type: object
          required:
            - user_id
            - user_group_id
            - start_datetime
            - expiry_datetime
          properties:
            user_id:
              type: string
              description: >-
                ID of the User. Unique. When User ID Type in **Setting** →
                **Server** is set to **Number**, a number between 1 and
                4294967295 can be entered. 


                When **Alphanumeric** is set, a combination of alphabetic
                characters and numbers can be entered. Do not use spaces when
                entering ID.


                Numbers or Alphanumeric characters can be set for `user_id`. For
                more details, refer to Setting Section of this documentation.
              example: '1001'
            name:
              type: string
              maxLength: 48
              description: Name of the user. Up to 48 characters.
              example: John Doe
            user_group_id:
              type: object
              description: >-
                ID of the User Group that the user will be under Refer to User
                Group Section of this documentation for listing available User
                Groups.
              properties:
                id:
                  type: string
                  description: User Group ID
                  example: '1'
            disabled:
              type: boolean
              description: Toggle User active or not; false for active, true for non-active
              example: false
            start_datetime:
              type: string
              format: date-time
              description: Start active period for the User
              example: '2001-01-01T00:00:00.00Z'
            expiry_datetime:
              type: string
              format: date-time
              description: End active period for the User
              example: '2030-12-31T23:59:00.00Z'
            email:
              type: string
              format: email
              description: Email address of the User
              example: john.doe@example.com
            department:
              type: string
              maxLength: 64
              description: Department of the User. Up to 64 characters.
              example: Engineering
            title:
              type: string
              description: Title of the User
              example: Software Engineer
            photo:
              type: string
              format: base64
              description: Photo of the User (Base64 encoded)
              example: ''
            phone:
              type: string
              description: Phone number of the User
              example: +1-555-0123
            permission:
              type: object
              description: Operator Level of the User
              properties:
                id:
                  type: string
                  description: >
                    Permission ID (1=Administrator, 2=User Operator,
                    3=Monitoring Operator, 253=Video Operator, 254=T&A Operator,
                    255=User)


                    - **Administrator**: The user can use all menus.  


                    - **User Operator**: The user can only use the USER and
                    PREFERENCE menus. 


                    - **Monitoring Operator**: The user can use the MONITORING
                    and PREFERENCE menus and only view the DASHBOARD, USER,
                    DEVICE, DOOR, ZONE and ACCESS CONTROL menus.


                    - **Video Operator**: The user can only use the VIDEO menu.


                    - **T&A Operator**: The user can only use the TIME
                    ATTENDANCE menu and only view the USER menu.


                    - **User**: The user can only view own information and T&A
                    records.
                  example: '1'
            access_groups:
              type: array
              description: >-
                ID of the Access Group that the User will have access. Refer to
                Access Group Section of this documentation for listing available
                Access Groups.  <br>Can enter more than 1 Access Group.
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: Access Group ID
                    example: '1'
            login_id:
              type: string
              description: Required when permission parameter is not removed.
              example: john.doe
            password:
              type: string
              description: Required when permission parameter is not removed.
              example: ZxwOzbCK2VQ1dyv
            user_ip:
              type: string
              description: >-
                Limit the access of the User so he/she can only login from the
                registered IP Address. The user IP can be entered in the format
                xxx.xxx.xxx.xxx. Each octet can only be entered in numbers
                between 0 and 255. Users whose user IP is not registered can log
                in from any IP.
              example: 192.168.1.100
            pin:
              type: integer
              maxLength: 32
              description: PIN of the user. Maximum 32 digit.
              example: 1234
    UserGroupUpdateInput:
      type: object
      description: Input for updating user group name
      required:
        - name
      properties:
        UserGroup:
          type: object
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 48
              description: New name for the user group
              example: TestDataXFer3xx
    UserGroupSearchInput:
      type: object
      description: Input for searching User Groups by ID list
      properties:
        user_group_id_list:
          type: array
          description: >-
            Specify User Group ids which will be viewed. Use comma (,) as
            separator.
          items:
            type: string
            description: User Group ID
          example:
            - '1004'
            - '21109'
    UserGroupInput:
      type: object
      description: Input for creating a new User Group
      required:
        - UserGroup
      properties:
        UserGroup:
          type: object
          required:
            - parent_id
            - name
          properties:
            parent_id:
              type: object
              description: Parent User Group information
              required:
                - id
              properties:
                id:
                  type: integer
                  description: Parent ID of the new User Group
                  example: 1
            depth:
              type: integer
              description: >-
                Depth of the User Group based on the parent (automatically
                calculated if not provided).
              maximum: 8
              example: 1
            name:
              type: string
              description: Name of the User Group.
              maxLength: 48
              example: TestDataXFer3
    VisualFaceEmailInput:
      type: object
      description: Input for sending Visual Face mobile enrollment link by email
      required:
        - id
        - language
        - adv_criteria
      properties:
        id:
          type: string
          description: User ID
          example: '1'
        language:
          type: string
          description: >-
            Language which will be used for the email content. (ko=Korean,
            en=English, ja=Japanese)
          enum:
            - ko
            - en
            - ja
          example: en
        adv_criteria:
          type: object
          description: >-
            Advanced search criteria for batch processing. See Batch Edit with
            Advanced Search for `adv_criteria` details
          properties:
            user_name:
              type: string
              description: User name filter
              nullable: true
              example: e
            user_operator_level_id:
              type: string
              description: User operator level ID filter
              example: '0'
            user_group_id:
              type: integer
              description: User group ID filter
              example: 1
            user_group_ids:
              type: array
              description: Array of user group IDs for filtering
              items:
                type: integer
              example: []
            user_custom_field_1:
              type: string
              description: Custom field 1 filter
            user_custom_field_2:
              type: string
              description: Custom field 2 filter
            user_custom_field_3:
              type: string
              description: Custom field 3 filter
            user_custom_field_4:
              type: string
              description: Custom field 4 filter
            user_custom_field_5:
              type: string
              description: Custom field 5 filter
            user_custom_field_6:
              type: string
              description: Custom field 6 filter
            user_custom_field_7:
              type: string
              description: Custom field 7 filter
            user_custom_field_8:
              type: string
              description: Custom field 8 filter
            user_custom_field_9:
              type: string
              description: Custom field 9 filter
            user_custom_field_10:
              type: string
              description: Custom field 10 filter
    EmailQRInput:
      type: object
      description: Input for sending BioStar X QR by email
      required:
        - id
        - language
        - card_collection
        - total
      properties:
        id:
          type: integer
          description: >-
            ID of the user which the QR code applied to and the email will be
            sent to.
          example: 1
        language:
          type: string
          description: Language for the email content. (ko=Korean, en=English)
          enum:
            - ko
            - en
          example: en
        card_collection:
          type: array
          description: Collection of QR cards to be sent via email
          minItems: 1
          items:
            type: object
            required:
              - id
              - card_id
              - display_card_id
              - card_type
            properties:
              id:
                type: integer
                description: ID of the QR which will be sent to the user email
                example: 10072
              card_id:
                type: integer
                description: ID of the card as recorded on BioStar X database
                example: 3.045804110617691e+33
              display_card_id:
                type: integer
                description: ID which will be shown when scanning/reading the card
                example: 165113371684849
              card_type:
                type: object
                description: Card type information
                required:
                  - id
                  - name
                  - type
                properties:
                  id:
                    type: integer
                    description: ID for the card type
                    example: 7
                  name:
                    type: string
                    description: Name of the card type
                    example: SCQr
                  type:
                    type: integer
                    description: Type code of the card type
                    example: 7
        total:
          type: integer
          description: Total number of cards in the collection
          example: 1
    MobileCardInput:
      type: object
      description: Input for creating Mobile Card (Smart card with mobile credentials)
      required:
        - SmartCard
      properties:
        SmartCard:
          type: object
          required:
            - user_id
            - card_id
            - card_layout_id
            - options
          properties:
            user_id:
              type: object
              description: User information and biometric templates
              required:
                - user_id
              properties:
                user_id:
                  type: integer
                  description: >-
                    User ID of the user which will be using this card and which
                    the biometric will be linked to.
                  minimum: 1
                  example: 1
                fingerprint_templates:
                  type: array
                  description: Fingerprint templates of the user.
                  items:
                    type: object
                    properties:
                      finger_index:
                        type: integer
                        description: Fingerprint template finger index.
                        example: 0
                  example:
                    - finger_index: 0
            card_id:
              type: object
              description: Card identification information
              required:
                - card_id
                - card_type_id
              properties:
                card_id:
                  type: integer
                  description: >-
                    Card ID which will be displayed and recorded on the system.
                    Use the same number as user_id
                  example: 102
                card_type_id:
                  type: object
                  description: Type of the card which will be created
                  required:
                    - id
                  properties:
                    id:
                      type: integer
                      description: Card type ID
                      example: 2
            card_layout_id:
              type: object
              description: Layout ID for Mobile Credential
              required:
                - id
              properties:
                id:
                  type: integer
                  description: Layout ID for Mobile Credential which has been created.
                  example: 4
            options:
              type: object
              description: Mobile credential options
              required:
                - is_a_mobile_credential
              properties:
                is_a_mobile_credential:
                  type: boolean
                  description: Toggle true if the card is Mobile Credential
                  example: true
    AccessOnCardInput:
      type: object
      description: Input for creating Access on Card (Smart card)
      required:
        - SmartCard
      properties:
        SmartCard:
          type: object
          required:
            - user_id
            - card_id
          properties:
            user_id:
              type: object
              description: User information and biometric templates
              required:
                - user_id
                - use_alphanumeric_user_id
              properties:
                user_id:
                  type: integer
                  description: >-
                    User ID of the user which will be using this card and which
                    the biometric will be linked to.
                  example: 8
                fingerprint_templates:
                  type: array
                  description: Fingerprint templates of the user
                  items:
                    type: object
                    properties:
                      finger_index:
                        type: integer
                        description: Fingerprint template finger index
                        example: 0
                  example:
                    - finger_index: 0
                visual_face_templates:
                  type: array
                  description: Visual face templates of the user
                  items:
                    type: object
                  example: []
            card_id:
              type: object
              description: Card identification information
              required:
                - card_id
                - card_type_id
              properties:
                card_id:
                  type: integer
                  description: >-
                    Card ID which will be displayed and recorded on the system.
                    Use the same number as `user_id`.
                  example: 8
                card_type_id:
                  type: object
                  description: Type of the card which will be created.
                  required:
                    - id
                  properties:
                    id:
                      type: integer
                      description: |-
                        Card type ID (3 for Access on Card)
                        - `1`: CSN
                        - `2`: SECURE
                        - `3`: ACCESS
                        - `4`: WIEGAND
                      example: 3
                use_alphanumeric_user_id:
                  type: boolean
                  description: Toggle true if user_id uses alphanumeric setting.
                  example: false
    CardInput:
      type: object
      description: Input for creating a new card
      required:
        - CardCollection
      properties:
        CardCollection:
          type: object
          required:
            - rows
          properties:
            rows:
              type: array
              description: Array of card objects to create
              items:
                type: object
                required:
                  - card_type
                  - card_id
                properties:
                  card_type:
                    type: object
                    description: Card type configuration
                    required:
                      - id
                      - type
                    properties:
                      id:
                        type: integer
                        description: >-
                          Type card id of the card: 0: CSN card, 1: Wiegand
                          Card, 2: Secure Credential Card (Smart card), 3:
                          Access on Card (Smart card), 4: Mobile CSN Card, 5:
                          Wiegand Mobile, 6: QR/Barcode, 7: BioStar X QR,
                        enum:
                          - 0
                          - 1
                          - 2
                          - 3
                          - 4
                          - 5
                          - 6
                          - 7
                        example: 7
                      type:
                        type: integer
                        description: >-
                          Type allocation of the card type. View the list using
                          `/api/cards/types` to determine the correct value
                        example: 7
                  display_card_id:
                    type: integer
                    description: Display card ID shown in the interface
                    example: 33333333333
                  card_id:
                    type: integer
                    description: >-
                      Input value shown/read when scanning the card. Must be
                      unique
                    example: 33333333333
    WiegandFormatInput:
      type: object
      description: Input for updating Wiegand format configuration
      properties:
        WiegandFormat:
          type: object
          properties:
            id:
              type: string
              description: ID of the Wiegand format
              example: '5'
            name:
              type: string
              description: Name of the Wiegand format
              example: Custom Format
            description:
              type: string
              description: Description of the Wiegand format
              example: Custom Wiegand format description
            length:
              type: integer
              description: Total bits of the card
              example: 32
            use_facility_code:
              type: boolean
              description: Toggle to use facility code
              enum:
                - true
                - false
              example: true
            id_fields:
              type: array
              description: >-
                Encoded input of the ID bits. Facility code will also be placed
                here
              items:
                type: string
                format: base64
              example:
                - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgAAAA=
                - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf///4=
            parity_fields:
              type: array
              description: Encoded input of the parity bits
              items:
                type: string
                format: base64
              example:
                - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAA=
                - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE=
            parity_types:
              type: array
              description: Parity types (1=Odd, 2=Even)
              items:
                type: integer
                enum:
                  - 1
                  - 2
              example:
                - 1
                - 2
            parity_positions:
              type: array
              description: >-
                Position of the parity bits. Put it on the same sequence as
                parity_types
              items:
                type: integer
              example:
                - 0
                - 31
    AccessLevelInput:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: The name of the Access Level. Must be unique
        description:
          type: string
          description: Access Level description
        access_level_items:
          type: array
          description: Array of access level items linking doors to schedules
          items:
            type: object
            properties:
              doors:
                type: array
                description: List of door IDs for this schedule
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: Door ID
              schedule_id:
                type: object
                description: Schedule information for the doors
                properties:
                  id:
                    type: string
                    description: Schedule ID
    UserCollection:
      type: object
      properties:
        total:
          type: string
          description: Total number of users
        rows:
          type: array
          description: Array of user objects
          items:
            type: object
            properties:
              user_id:
                type: string
                description: User ID
              name:
                type: string
                description: User name
              updated_count:
                type: string
                description: Number of times the user has been updated
              disabled:
                type: boolean
                description: Whether the user is disabled
              flag:
                type: string
                description: User flag
              cards_count:
                type: string
                description: Number of cards
              fingerprint_templates_count:
                type: string
                description: Number of fingerprint templates
              face_count:
                type: string
                description: Number of face templates
              start_datetime:
                type: string
                description: Start date and time of user validity
              expiry_datetime:
                type: string
                description: Expiry date and time of user validity
              security_level:
                type: string
                description: Security level of the user
              private_operation_modes:
                type: string
                description: Private operation modes of the user
              credentials:
                type: object
                description: Credentials of the user
                properties:
                  visualFace:
                    type: array
                    description: Visual face credentials
                    items:
                      type: object
    AccessGroupUpdate:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: The name of the Access Group. Must be unique
        description:
          type: string
          description: Access Group description
        users:
          type: array
          description: >-
            Current list of user IDs for the Access Group (replaces existing
            users)
          items:
            type: object
            properties:
              user_id:
                type: integer
                description: User ID
        user_groups:
          type: array
          description: >-
            List of user group IDs for the Access Group (replaces existing user
            groups)
          items:
            type: object
            properties:
              id:
                type: integer
                description: User group ID
        access_levels:
          type: array
          description: >-
            List of access level IDs for the Access Group (replaces existing
            access levels)
          items:
            type: object
            properties:
              id:
                type: integer
                description: Access level ID
        floor_levels:
          type: array
          description: >-
            List of floor level IDs for the Access Group (replaces existing
            floor levels)
          items:
            type: object
            properties:
              id:
                type: string
                description: Floor level ID
              name:
                type: string
                description: Floor level name
        new_users:
          type: array
          description: List of user IDs to add to the Access Group
          items:
            type: object
            properties:
              user_id:
                type: integer
                description: User ID to add
        delete_users:
          type: array
          description: List of user IDs to remove from the Access Group
          items:
            type: object
            properties:
              user_id:
                type: integer
                description: User ID to remove
    AccessGroupDetail:
      type: object
      properties:
        id:
          type: string
          description: Access group ID
        name:
          type: string
          description: Access group name
        description:
          type: string
          description: Access group description
        users:
          type: array
          description: List of users in the access group
          items:
            type: object
            properties:
              name:
                type: string
                description: User name
              user_id:
                type: string
                description: User ID
        user_count:
          type: string
          description: Total number of users in the access group
        user_groups:
          type: array
          description: List of user groups in the access group
          items:
            type: object
            properties:
              id:
                type: string
                description: User group ID
              name:
                type: string
                description: User group name
              description:
                type: string
                description: User group description
              parent_id:
                type: object
                description: Parent group information
                properties:
                  id:
                    type: string
                    description: Parent group ID
                  name:
                    type: string
                    description: Parent group name
              depth:
                type: string
                description: Group hierarchy depth
              inherited:
                type: string
                description: Whether access is inherited
              face_count:
                type: string
                description: Number of face templates
              user_count:
                type: string
                description: Number of users in the group
              user_groups:
                type: array
                description: Nested user groups
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
        access_levels:
          type: array
          description: List of access levels
          items:
            type: object
            properties:
              id:
                type: string
                description: Access level ID
              name:
                type: string
                description: Access level name
              description:
                type: string
                description: Access level description
        floor_levels:
          type: array
          description: List of floor levels (elevator module)
          items:
            type: object
            properties:
              id:
                type: string
                description: Floor level ID
              name:
                type: string
                description: Floor level name
              description:
                type: string
                description: Floor level description
    AccessGroupSearchResult:
      type: object
      description: Search result for Access Groups (v2 API)
      properties:
        total:
          type: integer
          description: Total number of access groups
        rows:
          type: array
          description: Array of simplified access group objects
          items:
            type: object
            properties:
              id:
                type: integer
                description: Access group ID
              name:
                type: string
                description: Access group name
              users:
                type: array
                description: List of users in the access group
                items:
                  type: object
                  properties:
                    user_id:
                      type: string
                      description: User ID
                    name:
                      type: string
                      description: User name
              user_groups:
                type: array
                description: List of user groups in the access group
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: User group ID
                    name:
                      type: string
                      description: User group name
              access_levels:
                type: array
                description: List of access levels
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: Access level ID
                    name:
                      type: string
                      description: Access level name
              floor_levels:
                type: array
                description: List of floor levels (elevator module)
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: Floor level ID
                    name:
                      type: string
                      description: Floor level name
    UserResponse:
      type: object
      properties:
        User:
          $ref: '#/components/schemas/User'
        Response:
          $ref: '#/components/schemas/ApiResponse'
    User:
      type: object
      properties:
        user_id:
          type: string
          description: Unique identifier of the user
          example: '1'
        name:
          type: string
          description: Full name of the user
          example: Administrator
        gender:
          type: string
          description: Gender of the user (0=Unknown, 1=Male, 2=Female)
          example: '1'
        email:
          type: string
          format: email
          description: Email address of the user
          example: admin111@gmail.com
        birthday:
          type: string
          format: date-time
          description: Birthday of the user
          example: '1977-10-08T04:00:00.00Z'
        photo_exists:
          type: string
          description: Whether user photo exists
          example: 'false'
        pin_exists:
          type: string
          description: Whether user PIN exists
          example: 'false'
        login_id:
          type: string
          description: Login ID of the user
          example: admin
        password_exists:
          type: string
          description: Whether user password exists
          example: 'true'
        updated_count:
          type: string
          description: Number of times user has been updated
          example: '15'
        last_modified:
          type: string
          description: Last modification timestamp
          example: '946'
        idx_last_modified:
          type: string
          description: Index last modification timestamp
          example: '263'
        start_datetime:
          type: string
          format: date-time
          description: User access start date and time
          example: '2001-01-01T00:00:00.00Z'
        expiry_datetime:
          type: string
          format: date-time
          description: User access expiry date and time
          example: '2030-12-31T23:59:00.00Z'
        security_level:
          type: string
          description: Security level of the user
          example: '0'
        display_duration:
          type: string
          description: Display duration setting
          example: '20'
        display_count:
          type: string
          description: Display count setting
          example: '3'
        permission:
          $ref: '#/components/schemas/Permission'
        inherited:
          type: string
          description: Whether permissions are inherited
          example: 'false'
        user_group_id:
          $ref: '#/components/schemas/UserGroup'
        disabled:
          type: string
          description: Whether user is disabled
          example: 'false'
        expired:
          type: string
          description: Whether user is expired
          example: 'false'
        department:
          type: string
          description: Department of the user
          example: department 12
        user_title:
          type: string
          description: Title of the user
          example: title
        idx_user_id:
          type: string
          description: Index user ID
          example: '1001'
        idx_user_id_num:
          type: string
          description: Index user ID number
          example: '1001'
        idx_name:
          type: string
          description: Index name
          example: '2001'
        idx_phone:
          type: string
          description: Index phone
          example: '1001'
        idx_email:
          type: string
          description: Index email
          example: '5001'
        fingerprint_template_count:
          type: string
          description: Number of fingerprint templates
          example: '0'
        face_count:
          type: string
          description: Number of face templates
          example: '0'
        card_count:
          type: string
          description: Number of cards
          example: '0'
        access_groups:
          type: array
          items:
            $ref: '#/components/schemas/AccessGroup'
          description: Access groups assigned to the user
        user_custom_fields:
          type: array
          items:
            $ref: '#/components/schemas/UserCustomField'
          description: Custom fields for the user
        need_to_update_pw:
          type: string
          description: Whether user needs to update password
          example: 'false'
    Permission:
      type: object
      properties:
        id:
          type: string
          description: Permission ID
          example: '1'
        name:
          type: string
          description: Permission name
          example: Administrator
        description:
          type: string
          description: Permission description
          example: this is a permission for Administrator
        filter:
          $ref: '#/components/schemas/PermissionFilter'
        module:
          $ref: '#/components/schemas/ModulePermissions'
        device:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
          description: Device permissions
        user:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
          description: User permissions
    PermissionFilter:
      type: object
      properties:
        UserGroup:
          type: array
          items:
            type: string
          example:
            - '1'
        DeviceGroup:
          type: array
          items:
            type: string
          example:
            - '1'
        DoorGroup:
          type: array
          items:
            type: string
          example:
            - '1'
        ElevatorGroup:
          type: array
          items:
            type: string
          example:
            - '1'
        ZoneType:
          type: array
          items:
            type: string
          example:
            - '-1'
        AccessGroup:
          type: array
          items:
            type: string
          example:
            - '0'
        GraphicMapGroup:
          type: array
          items:
            type: string
          example:
            - '1'
    ModulePermissions:
      type: object
      properties:
        Dashboard:
          $ref: '#/components/schemas/ModulePermission'
        User:
          $ref: '#/components/schemas/ModulePermission'
        Device:
          $ref: '#/components/schemas/ModulePermission'
        Door:
          $ref: '#/components/schemas/ModulePermission'
        Elevator:
          $ref: '#/components/schemas/ModulePermission'
        Zone:
          $ref: '#/components/schemas/ModulePermission'
        AccessControl:
          $ref: '#/components/schemas/ModulePermission'
        Monitoring:
          $ref: '#/components/schemas/ModulePermission'
        TA:
          $ref: '#/components/schemas/ModulePermission'
        Setting:
          $ref: '#/components/schemas/ModulePermission'
        Video:
          $ref: '#/components/schemas/ModulePermission'
        Visitor:
          $ref: '#/components/schemas/ModulePermission'
    ModulePermission:
      type: object
      properties:
        read:
          type: string
          description: Read permission
          example: 'true'
        write:
          type: string
          description: Write permission
          example: 'true'
    UserGroup:
      type: object
      properties:
        id:
          type: string
          description: User group ID
          example: '1'
        name:
          type: string
          description: User group name
          example: All Users
    AccessGroup:
      type: object
      properties:
        id:
          type: string
          description: Access group ID
          example: '1'
        name:
          type: string
          description: Access group name
          example: Meeting Room 1 AG
    UserCustomField:
      type: object
      properties:
        user_id:
          type: object
          properties:
            user_id:
              type: string
              example: '1'
            name:
              type: string
              example: Administrator
        custom_field:
          type: object
          properties:
            id:
              type: string
              example: '1'
            name:
              type: string
              example: Test
            type:
              type: string
              example: '0'
            order:
              type: string
              example: '1'
    UserAdvancedSearchDeleteInput:
      type: object
      description: Input for deleting users with advanced search
      required:
        - adv_criteria
      properties:
        adv_criteria:
          $ref: '#/components/schemas/AdvancedSearchCriteria'
    ApiResponse:
      type: object
      properties:
        code:
          type: string
          description: >-
            Response code `0` (Overall success), `1` (Partial success), `8`
            (Overall failed)
          example: '0'
        link:
          type: string
          description: Support link for additional help
          example: https://support.supremainc.com/en/support/home
        message:
          type: string
          description: Response message
          example: Success
        by:
          type: string
          example: web
    ApiResponse700:
      type: object
      properties:
        code:
          type: string
          description: Response code (0=Success, non-zero=Error)
          example: '700'
        link:
          type: string
          description: Support link for additional help
          example: https://support.supremainc.com/en/support/home
        message:
          type: string
          description: Response message
          example: Failed to parse json data.
