7 Replies Latest reply on Aug 18, 2021 4:33 AM by Vishesh R Simha

    REST API To fetch history data in P360

    Vishesh R Simha Guru

      Hi

       

      Is there any REST API to fetch history data or audit trail information of an item or product in Informatica P360.

       

      Also is there a way to invoke REST API calls from P360 Flex UI or P360 dashboards.

        • 1. Re: REST API To fetch history data in P360
          Sai Narasimha Prasad Rebba Guru

          Hi Vishesh,

           

          You can get the softDeleted records from the rest API call. The mode for loading soft-deleted objects. Possible values:

          ALIVE_ONLY - Only include non-deleted objects in the result list. This is the default mode.DEAD_OR_ALIVE - Include both non-deleted and soft-deleted objects into the result list. In terms of sub-entity records, always the "newest" value is provided, meaning that if a non-deleted object for the current qualification exists, this one will be returned, and if only deleted objects exist, the one with the latest deletion timestamp will be returned, respectively.

           

          But if you really want to the audit trial information related to EntityChanges. Please go through the below examples.

           

          Retrieve EntityChange by ID 11:

          POST http://HOST:PORT/rest/entityChange/11

           

          Retrieve EntityChanges:

          POST http://localhost:2801/rest/entityChanges

           

          The following JSON object is provided as content:

          {

              "offset":1,

              "limit":50,

              "criterias":

              [

                  {"field":

                  {

                      "type":"FieldEntityName",

                      "value":"Item"

                  },

                  "operation":"EQUAL"

                  },

                  {"field":

                  {

                      "type":"FieldUserName",

                      "value":"rest"

                  },

                  "operation":"EQUAL"

                  },

                  {"field":

                  {

                      "type":"FieldChangeType",

                      "value":"CREATED"

                  },

                  "operation":"EQUAL"

                  },

                  {"field":

                  {

                      "type":"FieldModificationDate",

                      "value":54326

                  },

                  "operation":"GREATER"

                  },

                  {"field":

                  {

                      "type":"FieldModificationDate",

                      "value":87658

                  },

                  "operation":"LESS"

                  }

              ]

          }

           

          Retrieve RootEntityChanges:

          POST http://localhost:2801/rest/rootEntityChanges

           

          The following JSON object is provided as content:

          {

              "offset":1,

              "limit":50,

              "criterias":

              [

                  {"field":

                  {

                      "type":"FieldEntityName",

                      "value":"Item"

                  },

                  "operation":"EQUAL"

                  },

                  {"field":

                  {

                      "type":"FieldUserName",

                      "value":"rest"

                  },

                  "operation":"EQUAL"

                  },

                  {"field":

                  {

                      "type":"FieldChangeType",

                      "value":"CREATED"

                  },

                  "operation":"EQUAL"

                  },

                  {"field":

                  {

                      "type":"FieldModificationDate",

                      "value":85733

                  },

                  "operation":"GREATER"

                  },

                  {"field":

                  {

                      "type":"FieldModificationDate",

                      "value":44543

                  },

                  "operation":"LESS"

                  }

              ]

          }

           

          Retrieve FieldValues by FieldChangeID 1:

          POST-http://localhost:2801/rest/fieldValues/1

           

          Retrieve EntityLogicalKeys:

          POST http://localhost:2801/rest/entityLogicalKeys

           

          NOTE: Please use the defined user from the AuditTrailNetworkConfig.xml.  This feature available since P360 8.1.1

           

          Thank you

          Sai Prasad

          • 2. Re: REST API To fetch history data in P360
            Sai Narasimha Prasad Rebba Guru

            Content

            The content has to be a JSON object searchQuery which includes the properties listed below.

            searchQuery

             

            Field

             

            Required

            Datatype

            Parameter description

            Example

            offsetnointegeroffset to the first result of hibernate query0
            limitnointegerlimit to the maximal result of hibernate query100
            criteriasnoList of SearchCriteriaList of SearchCriteria object
            "criterias": [ {"field": { "type":"FieldEntityName", "value":"Item" }, "operation":"EQUAL" }, {"field": { "type":"FieldUserName", "value":"rest" }, "operation":"EQUAL" },

            ...

            ]

            SearchCriteria

             

            Field

             

            Required

            Datatype

            Parameter description

            Example

            fieldyesfield definitionDefines field type and it's value
            "field":
            {
              "type":"FieldEntityName", "value":"Item" }
            operationyesenum entry of OperationDefines operation

            one of the following definition:

            "LESS",

            "GREATER",

            "EQUAL",

            "CONTAIN"

            field

             

            Field

            Required

            Datatype

            Parameter description

            Example

            typeyes String Defines field type

            one of the following types:

            "FieldChangeType",

            "FieldEntityRevisionId",

            "FieldHpmIdDataSource",

            "FieldHpmIdEntityIdentifier",

            "FieldHpmIdInternalId",

            "FieldParentHpmIdDataSource",

            "FieldParentHpmIdDataSource",

            "FieldParentHpmIdInternalId",

            "FieldEntityInstanceLabel",

            "FieldEntityName",

            "FieldEntityType",

            "FieldParentProxyLabel",

            "FieldUserName",

            "FieldModificationDate",

            "FieldUserInternalId"

            valueyes value object Defines field value"Item"

             

            Thank you

            Sai Prasad

            • 3. Re: REST API To fetch history data in P360
              Sai Narasimha Prasad Rebba Guru

              Hi Vishesh,

               

              The above info helped you?

               

              Thank you

              Sai Prasad

              • 4. Re: REST API To fetch history data in P360
                Vishesh R Simha Guru

                Hi Sai Prasad,

                 

                Should we use GET or POST method? POST method is to add or update and GET method is to read, right?

                • 5. Re: REST API To fetch history data in P360
                  Sai Narasimha Prasad Rebba Guru

                  Hi Vishesh,

                   

                  Yes, That is the POST call. Please take a look at the second post as well. It gives data based on SearchQuery, SearchCriteria and Filed changes. Thank you!

                  • 6. Re: REST API To fetch history data in P360
                    Lokesh Kumar Guru

                    There is no rest api around fetching the results of Audit trail through API as of v10.0. However from v10.1 (upcoming versions) Elastic Search is used to store Audit info where you can use ES api's to get the documents and relevant data from it.

                     

                    - Lokesh Kumar

                    • 7. Re: REST API To fetch history data in P360
                      Vishesh R Simha Guru

                      Hi Sai Prasad,

                       

                      I was trying this using SOAP UI. However I got an error.

                       

                       

                      Can you let me know the reason for this. Below is the snippet of AuditTrailNetworkConfig.xml. Is there anything wrong with this which is causing the error?