How can we help?

Searching:

0 results found

Audits/Post

POST /odata/Audits/

Description

To create a new audit entry in the Axonize database.

See the following for request and response details ‒

See Also

Request ‒ Audits/Post

Property Type Description

Mandatory

entityName String The name of the entity (such as the name of the Device or the name of the User) on which the action (such as create or delete) was performed.
entityId String The unique identifier (such as tenantId or appId) on which the action was performed.
action String The action performed on the entity, such as Post, Put, Patch, Get or Delete. For example, to add a Device or Application.
category String The type of entity on which the action (described above) was performed, such as –

  • Devices
  • Products
  • Rules
  • Users
  • Applications
  • Events
  • Auth
userEmail String The email of the Axonize user that performed the action.
userId String The unique identifier (ID) of the Axonize user that performed the action.
requestDateTime DateTime The timestamp of the request for this action to be performed.
responseDateTime String The timestamp when the response was sent, which indicates when the event took place.
application String The name of the Application on which the action was performed.
tenant String The name of the Tenant of the Application on which the action was performed.
correlationId For internal Axonize use.
ip String The IP of the request sender.
result String The response code received as the result to the request.
request DurationMs String The number of milliseconds it took to fulfil the request.
requestURL String Shows the entire URL string used to execute the request, which is comprised of the domain, the Tenant and the action itself.
actionDisplay String Free text that describes the action.
categoryDisplay String Free text to describe the entity on which the action was performed (meaning the Device, Application or Product).
userName String Name of the user that performed the request, whether it is in the Axonize Portal or using the Axonize REST API.
roles Array String The roles of the user at the time the request was performed.
sourceName String The name of the service requester.
sourceType String/Enum The type of the requester –

  • Unknown
  • Portal
  • Rules Engine
  • XStream
  • Gateways
appId String The identifier of the Application of the Audit. This appId was returned in the response to the Applications/Post endpoint.
additionalInfo Strings This property consists of various keys and values that contain the properties used in the request body, such as a serial number.

{

  “Key”: “serialNumber”,

  “Value”: “NewSerialNumber”

}

Both mandatory and optional keys and values are provided.

Example JSON Audits/Post Request

 curl -X POST \

  https://api.stg.axonize.com/odata/audits/ \

-H ‘Authorization: Token’ \

 -H ‘Content-Type: application/json’ \

 -H ‘appId: 801A048A-9F23-429F-BF0D-B6D35B22771E’ \

  -d ‘{

“entityName”: “device123”,

       “entityId”: “1321233231123”,

       “action”: “CreateDevice”,

       “category”: “Devices”

}

Response ‒ Audits/Post

All the same properties in the request are returned in the response. In addition, the response that is returned also contains the following properties –

Property Type Description
id String A unique identifier automatically generated for this audit entry by Axonize.
isSuccessful Boolean Specifies whether the request was successful or not based on the status code in the response.
result String Specifies a string representing the status code of the response. For example, OK or BadRequest.
createDate, createUser, updateDate,
updateUser
See Common Response Properties.

Example JSON Audits/Post Response

Status 201 – Created

{

    “@odata.context”: “http://stg-axonizeapi-axonize.stg-ase-axonize.p.azurewebsites.net/odata/$metadata#Audits/$entity”,

    “entityName”: “device123”,

    “entityId”: “1321233231123”,

    “action”: ” CreateDevice “,

    “category”: “Devices”,

    “userEmail”: “System”,

    “userId”: null,

    “requestDateTime”: “2018-06-17T11:55:01.8164737Z”,

    “responseDateTime”: “2018-06-17T11:55:02.0196423Z”,

    “application”: “fcm2m”,

    “tenant”: “5851631d4e41925b98f08e13”,

    “correlationId”: “a4d94269-9847-4842-91de-663735e3ded5”,

    “ip”: “52.233.142.182”,

    “isSuccessful”: false,  

    “result”: “BadRequest”,

    “requestDurationMs”: 203.1686,

    “requestUrl”: “http://stg-axonizeapi-axonize.stg-ase-axonize.p.azurewebsites.net/odata/Devices/SendCommandToMultipleDevices”,

    “actionDisplay”: “msg_audit_sendcommandtomultipledevices”,

    “categoryDisplay”: “msg_audit_devices”,

    “userName”: null,

    “roles”: [

        “systemadmin”

    ],

    “sourceName”: null,

    “sourceType”: “Unknown”,

    “id”: “5b264c16e5cdcf55dc9805b8”,

    “appId”: “be517433-c4b8-4788-9258-1ba220435d63”,

    “createDate”: “2018-06-17T11:55:02.035Z”,

    “createUser”: null,

    “updateDate”: “0001-01-01T00:00:00Z”,

    “updateUser”: null,

    “additionalInfo”: [

        {

            “key”: “commandId”,

            “value”: “5a966c3e71da9b06b0f932e4”

        },

        {

            “key”: “deviceIds”,

            “value”: “[\r\n  \”5859b09b983df8100836aba1\”\r\n]”

        }

    ]

}