---
title: Check New Users with SAPM Account
slug: kron-pam-api-collection-340/check-new-users-with-sapm-account
docTags: 
createdAt: 2024-07-12T13:38:00.279Z
---

{
  "id": "tfyVjfucm3bUkr9qITDLf",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "{{url}}/aioc-rest-web/rest/sc/sapm/checkNewUsers",
    "name": "",
    "description": "<p>This API will make KRON PAM connect to the device of SAPM account(which you send dbId of) and check if there is any new user on that device. You can see new users that are found under \"New Users Log\" on WebUI.</p>",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "name": "X-XSRF-TOKEN",
          "description": "",
          "default": "{{csrftoken}}",
          "value": "{{csrftoken}}",
          "type": "string"
        }
      ],
      "queryParameters": [],
      "pathParameters": [
        {
          "name": "url",
          "description": "",
          "default": "url",
          "value": "url",
          "type": "string"
        }
      ],
      "bodyDataParameters": [
        {
          "name": "body",
          "description": "",
          "default": "{\r\n\t\"sapmDbId\":6778\r\n}",
          "value": "{\r\n\t\"sapmDbId\":6778\r\n}",
          "type": "object"
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Check New Users with SAPM Account",
        "jsonExample": "SUCCESS"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "D8WhXZkCpxwRe9X6ETpLG",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url {{url}}/aioc-rest-web/rest/sc/sapm/checkNewUsers \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-xsrf-token: {{csrftoken}}' \\\n     --data '\"{\\r\\n\\t\\\"sapmDbId\\\":6778\\r\\n}\"'"
        },
        {
          "id": "5IuKAT5pFR6nU1h1hdErE",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-xsrf-token\", \"{{csrftoken}}\");\n\nvar raw = JSON.stringify(\"{\\r\\n\\t\\\"sapmDbId\\\":6778\\r\\n}\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/sc/sapm/checkNewUsers\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "6sJ5LUknyHyVWqzQOoW4J",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/sapm/checkNewUsers\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\nrequest.body = JSON.dump(\"{\\r\\n\\t\\\"sapmDbId\\\":6778\\r\\n}\")\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "_eoH9GjtaTXSMWRGyMEKW",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/sapm/checkNewUsers\"\n\npayload = json.dumps(\"{\\r\\n\\t\\\"sapmDbId\\\":6778\\r\\n}\")\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "D8WhXZkCpxwRe9X6ETpLG"
    },
    "results": {
      "languages": [
        {
          "id": "quRa_rfYAm09HfIBrdK_K",
          "language": "200",
          "code": "SUCCESS"
        }
      ],
      "selectedLanguageId": "quRa_rfYAm09HfIBrdK_K"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}