---
title: /getAuditsForSwagger
slug: mihai-tests/getauditsforswagger
createdAt: 2024-01-09T12:30:00.567Z
---

{
  "id": "Y9WvWN0H5Xe4DmO2jnRPw",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "http://1.1.1.1/getAuditsForSwagger",
    "servers": [
      {
        "url": "http://1.1.1.1/getAuditsForSwagger"
      }
    ],
    "name": "",
    "description": "<ul>\n<li>return - Returns a list of all audit entries</li>\n</ul>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "start_time",
          "type": "string",
          "example": "2022-01-01",
          "description": "<p>string in the format \"yyyy-MM-dd\" representing the starting date and time for the audit log filter. Example: \"2022-01-01\"</p>",
          "default": "2022-01-01"
        },
        {
          "kind": "optional",
          "name": "end_time",
          "type": "string",
          "example": "2022-01-31",
          "description": "<p>string in the format \"yyyy-MM-dd\" representing the ending date and time for the audit log filter. Example: \"2022-01-31\"</p>",
          "default": "2022-01-31"
        },
        {
          "kind": "optional",
          "name": "account_id",
          "type": "string",
          "example": "123456",
          "description": "<p>string representing the ID of an account. Example: \"123456\".</p>",
          "default": "123456"
        },
        {
          "kind": "optional",
          "name": "account_ids",
          "type": "array",
          "example": "[\"123456\",\"789012\"]",
          "description": "array of strings representing the IDs of multiple accounts. Example: [\"123456\", \"789012\"].\n",
          "default": [
            "123456",
            "789012"
          ],
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "user_nick_name",
          "type": "string",
          "example": "john_doe",
          "description": "<p>string representing the nickname of a user (deprecated field). Example: \"john_doe\".</p>",
          "default": "john_doe"
        },
        {
          "kind": "optional",
          "name": "user_email",
          "type": "string",
          "example": "john.doe@example.com",
          "description": "<p>string representing the email address of a user. Example: \"<a href=\"mailto:john.doe@example.com\" target=\"_blank\">john.doe@example.com</a>\".</p>",
          "default": "john.doe@example.com"
        },
        {
          "kind": "optional",
          "name": "user_id",
          "type": "string",
          "example": "john.doe@example.com",
          "description": "<p>string in the format \"yyyy-MM-dd\" representing the starting date and time for the audit log filter. Example: \"2022-01-01\"</p>",
          "default": "john.doe@example.com"
        },
        {
          "kind": "optional",
          "name": "action",
          "type": "string",
          "example": "login",
          "description": "<p>string representing the type of action to filter on, such as \"login\" or \"logout\". Example: \"login\"</p>",
          "default": "login"
        },
        {
          "kind": "optional",
          "name": "limit",
          "type": "integer",
          "example": 50,
          "description": "<p>integer representing the maximum number of results to return. Example: 50.</p>",
          "default": 50
        },
        {
          "kind": "optional",
          "name": "machine",
          "type": "string",
          "example": "webserver01",
          "description": "<p>string representing the name of a machine. Example: \"webserver01\"</p>",
          "default": "webserver01"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "customType": "getAuditsForSwaggerResponse",
            "schema": [
              {
                "name": "FunctionData",
                "kind": "optional",
                "type": "object",
                "example": "",
                "schema": [
                  {
                    "name": "Audits",
                    "kind": "optional",
                    "type": "array",
                    "example": "",
                    "itemType": "object",
                    "customType": "object[]",
                    "schema": [
                      {
                        "name": "AccountId",
                        "kind": "optional",
                        "type": "string",
                        "description": "The ID of the account involved in this action",
                        "example": "1",
                        "default": "1"
                      },
                      {
                        "name": "Action",
                        "kind": "optional",
                        "type": "string",
                        "description": "The audit entry",
                        "example": "Send",
                        "default": "Send"
                      },
                      {
                        "name": "Description",
                        "kind": "optional",
                        "type": "string",
                        "description": "A description of the audit entry",
                        "example": "Stellar sent 100 to GCOBIQ7MK2DUXDTACJXJOLVSDUAQNYHJIORFA4IWL5C545FJWV5NNIZ2 (Account Main Account: MPC)",
                        "default": "Stellar sent 100 to GCOBIQ7MK2DUXDTACJXJOLVSDUAQNYHJIORFA4IWL5C545FJWV5NNIZ2 (Account Main Account: MPC)"
                      },
                      {
                        "name": "Machine",
                        "kind": "optional",
                        "type": "string",
                        "description": "COLD or MPC",
                        "example": "COLD",
                        "default": "COLD"
                      },
                      {
                        "name": "Time",
                        "kind": "optional",
                        "type": "string",
                        "description": "The time the action was initiated",
                        "example": "26-07-2021 17:03:25",
                        "default": "26-07-2021 17:03:25"
                      },
                      {
                        "name": "UserId",
                        "kind": "optional",
                        "type": "string",
                        "description": "The ID of the user that initiated the action",
                        "example": "bob@gk8.io",
                        "default": "bob@gk8.io"
                      },
                      {
                        "name": "UserNickname",
                        "kind": "optional",
                        "type": "string",
                        "description": "The Login name of the user that initiated the action",
                        "example": "bob bobson",
                        "default": "bob bobson"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "Meta",
                "kind": "optional",
                "type": "object",
                "modelRef": "#/components/schemas/MetaResponse",
                "customType": "MetaResponse",
                "schema": [
                  {
                    "name": "AccessToken",
                    "kind": "optional",
                    "type": "string",
                    "description": "The new access token generated after this operation",
                    "example": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6",
                    "default": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6"
                  },
                  {
                    "name": "Destination",
                    "kind": "optional",
                    "type": "string",
                    "description": "Id of the server",
                    "example": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622",
                    "default": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622"
                  },
                  {
                    "name": "Source",
                    "kind": "optional",
                    "type": "string",
                    "description": "User public key",
                    "example": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355",
                    "default": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355"
                  },
                  {
                    "name": "Time",
                    "kind": "optional",
                    "type": "string",
                    "description": "UTC Time of execution",
                    "example": "2021-02-14 09:58:52.320",
                    "default": "2021-02-14 09:58:52.320"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/getAuditsForSwaggerResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url 'http://1.1.1.1/getAuditsForSwagger?start_time=2022-01-01&end_time=2022-01-31&account_id=123456&account_ids=123456%2C789012&user_nick_name=john_doe&user_email=john.doe%40example.com&user_id=john.doe%40example.com&action=login&limit=50&machine=webserver01' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"http://1.1.1.1/getAuditsForSwagger?start_time=2022-01-01&end_time=2022-01-31&account_id=123456&account_ids=123456,789012&user_nick_name=john_doe&user_email=john.doe@example.com&user_id=john.doe@example.com&action=login&limit=50&machine=webserver01\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"http://1.1.1.1/getAuditsForSwagger?start_time=2022-01-01&end_time=2022-01-31&account_id=123456&account_ids=123456,789012&user_nick_name=john_doe&user_email=john.doe@example.com&user_id=john.doe@example.com&action=login&limit=50&machine=webserver01\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"http://1.1.1.1/getAuditsForSwagger?start_time=2022-01-01&end_time=2022-01-31&account_id=123456&account_ids=123456,789012&user_nick_name=john_doe&user_email=john.doe@example.com&user_id=john.doe@example.com&action=login&limit=50&machine=webserver01\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// success\n{\n  \"FunctionData\": {\n    \"Audits\": [\n      {\n        \"AccountId\": \"1\",\n        \"Action\": \"Send\",\n        \"Description\": \"Stellar sent 100 to GCOBIQ7MK2DUXDTACJXJOLVSDUAQNYHJIORFA4IWL5C545FJWV5NNIZ2 (Account Main Account: MPC)\",\n        \"Machine\": \"COLD\",\n        \"Time\": \"26-07-2021 17:03:25\",\n        \"UserId\": \"bob@gk8.io\",\n        \"UserNickname\": \"bob bobson\"\n      }\n    ]\n  },\n  \"Meta\": {\n    \"AccessToken\": \"a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6\",\n    \"Destination\": \"042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622\",\n    \"Source\": \"df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355\",\n    \"Time\": \"2021-02-14 09:58:52.320\"\n  }\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "id": "rX6gFkUEfO_aDaOWEqg5e",
      "type": "bulleted-list",
      "children": [
        {
          "id": "qYSZBNKALxStBNeo90j3Y",
          "type": "list-item",
          "children": [
            {
              "id": "yLdxfR-hW0ZdQN7kW-YKC",
              "type": "list-item-child",
              "children": [
                {
                  "text": "return - Returns a list of all audit entries"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}